Skip to content

Commit 69ca324

Browse files
committedOct 20, 2021
Add test to ensure that the missing_doc_code_examples is not triggered on foreign trait implementations
1 parent 6162529 commit 69ca324

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎src/test/rustdoc-ui/doc-without-codeblock.rs

+9
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,12 @@ pub mod foo {
1111
//~^ ERROR missing code example in this documentation
1212
pub fn bar() {}
1313
}
14+
15+
// This impl is here to ensure the lint isn't emitted for foreign traits implementations.
16+
impl std::ops::Neg for Foo {
17+
type Output = Self;
18+
19+
fn neg(self) -> Self::Output {
20+
Self
21+
}
22+
}

‎src/test/rustdoc-ui/doc-without-codeblock.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | |
66
LL | | /// Some docs.
77
LL | |
88
... |
9-
LL | | pub fn bar() {}
9+
LL | | }
1010
LL | | }
1111
| |_^
1212
|

0 commit comments

Comments
 (0)