]> git.proxmox.com Git - rustc.git/blob - src/test/ui/unused/useless-comment.rs
New upstream version 1.53.0+dfsg1
[rustc.git] / src / test / ui / unused / useless-comment.rs
1 #![feature(stmt_expr_attributes)]
2
3 #![deny(unused_doc_comments)]
4
5 macro_rules! mac {
6 () => {}
7 }
8
9 /// foo //~ ERROR unused doc comment
10 mac!();
11
12 fn foo() {
13 /// a //~ ERROR unused doc comment
14 let x = 12;
15
16 /// multi-line //~ unused doc comment
17 /// doc comment
18 /// that is unused
19 match x {
20 /// c //~ ERROR unused doc comment
21 1 => {},
22 _ => {}
23 }
24
25 /// foo //~ ERROR unused doc comment
26 unsafe {}
27
28 #[doc = "foo"] //~ ERROR unused doc comment
29 #[doc = "bar"] //~ ERROR unused doc comment
30 3;
31
32 /// bar //~ ERROR unused doc comment
33 mac!();
34
35 let x = /** comment */ 47; //~ ERROR unused doc comment
36
37 /// dox //~ ERROR unused doc comment
38 {
39
40 }
41 }
42
43 fn main() {
44 foo();
45 }