From 69ca324a53c35bb9cd77c5635a9ecc4f201eaa1c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 20 Oct 2021 15:57:44 +0200 Subject: Add test to ensure that the missing_doc_code_examples is not triggered on foreign trait implementations --- src/test/rustdoc-ui/doc-without-codeblock.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/test/rustdoc-ui/doc-without-codeblock.rs') 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 + } +} -- cgit 1.4.1-3-g733a5