]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-ui/doc-without-codeblock.rs
Auto merge of #107644 - Zoxc:query-cache-tweak, r=cjgillot
[rust.git] / tests / rustdoc-ui / doc-without-codeblock.rs
1 #![feature(rustdoc_missing_doc_code_examples)] //~ ERROR missing code example in this documentation
2 #![deny(rustdoc::missing_doc_code_examples)]
3
4 /// Some docs.
5 //~^ ERROR missing code example in this documentation
6 pub struct Foo;
7
8 /// And then, the princess died.
9 //~^ ERROR missing code example in this documentation
10 pub mod foo {
11     /// Or maybe not because she saved herself!
12     //~^ ERROR missing code example in this documentation
13     pub fn bar() {}
14 }
15
16 // This impl is here to ensure the lint isn't emitted for foreign traits implementations.
17 impl std::ops::Neg for Foo {
18     type Output = Self;
19
20     fn neg(self) -> Self::Output {
21         Self
22     }
23 }