diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-10-20 15:57:44 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-10-20 16:52:56 +0200 |
| commit | 69ca324a53c35bb9cd77c5635a9ecc4f201eaa1c (patch) | |
| tree | fd408349849605e4dd5e434ff859ec3110a38ba3 | |
| parent | 6162529a01473bbb2427fa27354cbafc3c514eee (diff) | |
| download | rust-69ca324a53c35bb9cd77c5635a9ecc4f201eaa1c.tar.gz rust-69ca324a53c35bb9cd77c5635a9ecc4f201eaa1c.zip | |
Add test to ensure that the missing_doc_code_examples is not triggered on foreign trait implementations
| -rw-r--r-- | src/test/rustdoc-ui/doc-without-codeblock.rs | 9 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/doc-without-codeblock.stderr | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/test/rustdoc-ui/doc-without-codeblock.rs b/src/test/rustdoc-ui/doc-without-codeblock.rs index 6812a454157..315fca19587 100644 --- a/src/test/rustdoc-ui/doc-without-codeblock.rs +++ b/src/test/rustdoc-ui/doc-without-codeblock.rs @@ -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 + } +} diff --git a/src/test/rustdoc-ui/doc-without-codeblock.stderr b/src/test/rustdoc-ui/doc-without-codeblock.stderr index aac537e9783..1c138044165 100644 --- a/src/test/rustdoc-ui/doc-without-codeblock.stderr +++ b/src/test/rustdoc-ui/doc-without-codeblock.stderr @@ -6,7 +6,7 @@ LL | | LL | | /// Some docs. LL | | ... | -LL | | pub fn bar() {} +LL | | } LL | | } | |_^ | |
