Skip to content

Commit

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

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

Fixes rust-lang#76450.

r? `@jyn514`
  • Loading branch information
matthiaskrgr authored Oct 20, 2021
2 parents 6016109 + 69ca324 commit 36eba9f
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 36eba9f

Please sign in to comment.