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````
This commit is contained in:
Yuki Okushi 2021-10-21 14:11:12 +09:00 committed by GitHub
commit 68a5680fc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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
}
}

View File

@ -6,7 +6,7 @@ LL | |
LL | | /// Some docs.
LL | |
... |
LL | | pub fn bar() {}
LL | | }
LL | | }
| |_^
|