Skip to content

Commit

Permalink
Add test to ensure that the missing_doc_code_examples is not triggere…
Browse files Browse the repository at this point in the history
…d on foreign trait implementations
  • Loading branch information
GuillaumeGomez committed Oct 20, 2021
1 parent 6162529 commit 69ca324
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/test/rustdoc-ui/doc-without-codeblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ pub mod foo {
//~^ ERROR missing code example in this documentation
pub fn bar() {}
}

// This impl is here to ensure the lint isn't emitted for foreign traits implementations.
impl std::ops::Neg for Foo {
type Output = Self;

fn neg(self) -> Self::Output {
Self
}
}
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/doc-without-codeblock.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | |
LL | | /// Some docs.
LL | |
... |
LL | | pub fn bar() {}
LL | | }
LL | | }
| |_^
|
Expand Down

0 comments on commit 69ca324

Please sign in to comment.