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

This commit is contained in:
Guillaume Gomez 2021-10-20 15:57:44 +02:00
parent 6162529a01
commit 69ca324a53
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 | | }
| |_^
|