]> git.lizzy.rs Git - rust.git/blob - src/test/ui/useless_comment.rs
improve unused doc comment diagnostic reporting
[rust.git] / src / test / ui / useless_comment.rs
1 #![deny(unused_doc_comments)]
2
3 fn foo() {
4     /// a //~ ERROR doc comment not used by rustdoc
5     let x = 12;
6
7     /// multi-line //~ doc comment not used by rustdoc
8     /// doc comment
9     /// that is unused
10     match x {
11         /// c //~ ERROR doc comment not used by rustdoc
12         1 => {},
13         _ => {}
14     }
15
16     /// foo //~ ERROR doc comment not used by rustdoc
17     unsafe {}
18
19     #[doc = "foo"] //~ ERROR doc comment not used by rustdoc
20     #[doc = "bar"] //~ ERROR doc comment not used by rustdoc
21     3;
22 }
23
24 fn main() {
25     foo();
26 }