Skip to content
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

Safety section in outer block doc not detected #7327

Closed
MoAlyousef opened this issue Jun 6, 2021 · 2 comments
Closed

Safety section in outer block doc not detected #7327

MoAlyousef opened this issue Jun 6, 2021 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@MoAlyousef
Copy link

MoAlyousef commented Jun 6, 2021

Hi
Not a blocker, just noticed an issue with outer block docs.

Given the following code:

#![warn(clippy::missing_safety_doc)]

/**
    does blah
    # Safety
    boom
*/
pub unsafe fn blah() {}    

I expected to see this pass that clippy lint, escpecially since the docs reflect appropriately.

Instead, clippy outputs:

warning: unsafe function's docs miss `# Safety` section
 --> src/lib.rs:8:1
  |
8 | pub unsafe fn blah() {}    
  | ^^^^^^^^^^^^^^^^^^^^^^^
  |
note: the lint level is defined here
 --> src/lib.rs:1:9
  |
1 | #![warn(clippy::missing_safety_doc)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.53s

The problem is that changing the indentation and moving it to the left, fixes the issue, but messes doc rendering of any inlined code in the example section (which I have omitted here).

Meta

@MoAlyousef MoAlyousef added the C-bug Category: Clippy is not doing the correct thing label Jun 6, 2021
@giraffate giraffate added the I-false-positive Issue: The lint was triggered on code it shouldn't have label Jun 11, 2021
@giraffate
Copy link
Contributor

Thanks for the report!

It's a duplicate as #5593.

@MoAlyousef
Copy link
Author

Oh I’ll close this issue then.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

No branches or pull requests

2 participants