-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Summary
Consider the following code:
// SAFETY: trust me ok
long_var_name = unsafe {
/* ... */
};
Normally, rustfmt
will either leave the unsafe
block as above or convert this into the following, depending on its length:
// SAFETY: trust me ok
long_var_name = unsafe { /* ... */ };
However, in rare cases, if /* ... */
is exactly the right length, rustfmt
will emit:
// SAFETY: trust me ok
long_var_name =
unsafe { /* ... */ };
Which breaks the undocumented_unsafe_blocks
lint, since the comment isn't immediately before the line with unsafe
. It should accept cases like this.
Lint Name
undocumented_unsafe_blocks
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have