Skip to content

Commit

Permalink
Rollup merge of #90098 - GuillaumeGomez:add-test-foreign-impl-missing…
Browse files Browse the repository at this point in the history
…-doc-code-examples, r=jyn514

Add test to ensure that the missing_doc_code_examples is not triggered on foreign trait implementations

Fixes #76450.

r? ````@jyn514````
  • Loading branch information
JohnTitor authored Oct 21, 2021
2 parents 759a8ae + 69ca324 commit 68a5680
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 68a5680

Please sign in to comment.