Skip to content

Propagate accept-comment-above-attributes to statements #15213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2025

Conversation

blyxyas
Copy link
Member

@blyxyas blyxyas commented Jul 6, 2025

Turns out that things like #[attr]return unsafe { func(); } didn't work because we weren't checking above attributes on statements, only on blocks!

fixes #13189

Useful for Rust-For-Linux

changelog:[undocumented_unsafe_blocks]: Make sure to propagate accept-comment-above-attributes to all statements.

@rustbot
Copy link
Collaborator

rustbot commented Jul 6, 2025

r? @Jarcho

rustbot has assigned @Jarcho.
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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 6, 2025
Turns out that things like `#[attr]return unsafe { func(); }` didn't work
because we weren't checking above attributes on statements, only on blocks!
@blyxyas blyxyas force-pushed the rust-for-linux-bugfix1 branch from a8937b8 to e0e881f Compare July 6, 2025 00:23
@samueltardieu samueltardieu added this pull request to the merge queue Jul 6, 2025
Merged via the queue into rust-lang:master with commit 7c39d37 Jul 6, 2025
13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 6, 2025
@ojeda
Copy link
Contributor

ojeda commented Jul 6, 2025

Thanks Alejandra!

If I understand correctly, then all the cases in the issue now will pass because the reason was just that they were statements? Nice, this will help avoid confusion :)

@blyxyas
Copy link
Member Author

blyxyas commented Jul 6, 2025

then all the cases in the issue now will pass because the reason was just that they were statements?

I'll double-check, but yes, now we should check above attributes for all statements (So items, expressions that end in a ;, expressions that don't end ina a ; so they return their type, and let _ = _s).

Also, I'll make it a priority for the feature freeze to fix all the issues you mentioned in that tracking issue. If Rust-For-Linux encounters a really annoying bug (or even worse, a workflow-breaking bug) ping me/dm me on Zulip and I'll either add it to our Feature Freeze tracking issue, or fix it myself.

(Also, if you have a not-yet-resolved issue that you'd like to highlight, now it's the moment to link it)

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.

undocumented_unsafe_blocks false positives around attributes
5 participants