Skip to content

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

Merged
samueltardieu merged 1 commit into
rust-lang:masterfrom
blyxyas:rust-for-linux-bugfix1
Jul 6, 2025
Merged

Propagate accept-comment-above-attributes to statements#15213
samueltardieu merged 1 commit into
rust-lang:masterfrom
blyxyas:rust-for-linux-bugfix1

Conversation

@blyxyas

@blyxyas blyxyas commented Jul 6, 2025

Copy link
Copy Markdown
Member

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

rustbot commented Jul 6, 2025

Copy link
Copy Markdown
Collaborator

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

ojeda commented Jul 6, 2025

Copy link
Copy Markdown
Contributor

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

blyxyas commented Jul 6, 2025

Copy link
Copy Markdown
Member Author

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

5 participants