Skip to content

Commit

Permalink
Handle 'implementation safety' headers as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Oct 21, 2021
1 parent 91496c2 commit 1e8d9fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clippy_lints/src/doc.rs
Expand Up @@ -579,6 +579,8 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
continue;
}
headers.safety |= in_heading && text.trim() == "Safety";
headers.safety |= in_heading && text.trim() == "Implementation safety";
headers.safety |= in_heading && text.trim() == "Implementation Safety";
headers.errors |= in_heading && text.trim() == "Errors";
headers.panics |= in_heading && text.trim() == "Panics";
if in_code {
Expand Down
5 changes: 5 additions & 0 deletions tests/ui/doc_unsafe.rs
Expand Up @@ -125,3 +125,8 @@ pub mod __macro {
pub unsafe fn f() {}
}
}

/// # Implementation safety
pub unsafe trait DocumentedUnsafeTraitWithImplementationHeader {
fn method();
}

0 comments on commit 1e8d9fb

Please sign in to comment.