Skip to content

Conversation

@borngraced
Copy link
Contributor

@borngraced borngraced commented Jan 4, 2026

fixes false positives for undocumented_unsafe_blocks #16210

Same line comments in macros (e.g., let _x =// SAFETY: ...) and inner safety comments (e.g., unsafe { // SAFETY: ... }) were not recognized because

only checked for lines starting with // or /*.

note: block_has_inner_safety_comment does not respect accept-comment-above-statement or accept-comment-above-attributes. These configs control comments above statements or attributes; inner comments are inside the block, so no ambiguity exists.

changelog: [`undocumented_unsafe_block`]: recognize safety comments inside blocks and on same line in macros

r? @llogiq

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 4, 2026
@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Lintcheck changes for d37d04a

Lint Added Removed Changed
clippy::undocumented_unsafe_blocks 0 67 3

This comment will be updated if you push new changes

@borngraced borngraced force-pushed the fix-undocumented-unsafe-blocks branch from aee94d7 to 45b38ba Compare January 6, 2026 14:39
@rustbot
Copy link
Collaborator

rustbot commented Jan 6, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

allow only whitespace between the comment marker and `SAFETY:`
@borngraced borngraced force-pushed the fix-undocumented-unsafe-blocks branch from 03d8acd to d37d04a Compare January 7, 2026 09:03
@llogiq
Copy link
Contributor

llogiq commented Jan 11, 2026

Looks good to me. Thank you for working on this!

@llogiq llogiq added this pull request to the merge queue Jan 11, 2026
Merged via the queue into rust-lang:master with commit a47cbd0 Jan 11, 2026
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 11, 2026
@borngraced borngraced deleted the fix-undocumented-unsafe-blocks branch January 11, 2026 15:03
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.

3 participants