Skip to content

mark vstl1_* functions as unsafe#2092

Open
folkertdev wants to merge 1 commit intorust-lang:mainfrom
folkertdev:rcpc3-pub-unsafe
Open

mark vstl1_* functions as unsafe#2092
folkertdev wants to merge 1 commit intorust-lang:mainfrom
folkertdev:rcpc3-pub-unsafe

Conversation

@folkertdev
Copy link
Copy Markdown
Contributor

@folkertdev folkertdev commented Apr 24, 2026

fixes rust-lang/rust#155751

these functions write to a raw pointer, and so are clearly unsafe to use

static_defs: ["const LANE: i32"]
safety: safe
safety:
unsafe: [neon]
Copy link
Copy Markdown
Contributor Author

@folkertdev folkertdev Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamgemmell using neon here is not right, this is unsafe in its own right. I'm not sure if there are further safety conditions though, the link to the documentation that is generated for these functions does not work.

I also haven't quite reverse-engineered the right yaml to use to get a better message here.

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only SVE intrinsics have custom unsafety messages - originally all neon intrinsics were unsafe with the same message, and it looks like we never added proper messages when making the majority of them safe. I think just the pointer dereference is the only relevant safety condition here.

In my opinion, neon is fine and is in keeping with the rest of the neon intrinsics. If you're up for it a proper message would involve adding a variant of "UnsafetyComment" in intrinsic.rs and implementing Display for it (the Dereference variant which you'd otherwise use is specific to SVE as it makes reference to predicates)

these functions write to a raw pointer, and so are clearly unsafe to use
@folkertdev folkertdev marked this pull request as ready for review April 27, 2026 11:25
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 27, 2026

r? @sayantn

rustbot has assigned @sayantn.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @folkertdev, @sayantn
  • @Amanieu, @folkertdev, @sayantn expanded to Amanieu, folkertdev, sayantn
  • Random selection from Amanieu, sayantn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Safe Neon store-release intrinsics marked safe but should be unsafe

4 participants