Skip to content

Commit 68a5680

Browse files
authored
Rollup merge of #90098 - GuillaumeGomez:add-test-foreign-impl-missing-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````
2 parents 759a8ae + 69ca324 commit 68a5680

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)