2019-01-24 14:49:03 -06:00
|
|
|
#![feature(stmt_expr_attributes)]
|
|
|
|
|
2018-05-18 17:13:53 -05:00
|
|
|
#![deny(unused_doc_comments)]
|
2017-07-15 17:17:35 -05:00
|
|
|
|
2019-01-24 14:49:03 -06:00
|
|
|
macro_rules! mac {
|
|
|
|
() => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// foo //~ ERROR unused doc comment
|
|
|
|
mac!();
|
|
|
|
|
2017-07-15 17:17:35 -05:00
|
|
|
fn foo() {
|
2019-01-24 14:49:03 -06:00
|
|
|
/// a //~ ERROR unused doc comment
|
2017-07-15 17:17:35 -05:00
|
|
|
let x = 12;
|
|
|
|
|
2019-01-24 14:49:03 -06:00
|
|
|
/// multi-line //~ unused doc comment
|
2019-01-23 12:44:43 -06:00
|
|
|
/// doc comment
|
|
|
|
/// that is unused
|
2017-07-15 17:17:35 -05:00
|
|
|
match x {
|
2019-01-24 14:49:03 -06:00
|
|
|
/// c //~ ERROR unused doc comment
|
2017-07-15 17:17:35 -05:00
|
|
|
1 => {},
|
|
|
|
_ => {}
|
2017-07-01 18:37:47 -05:00
|
|
|
}
|
2017-07-15 17:17:35 -05:00
|
|
|
|
2019-01-24 14:49:03 -06:00
|
|
|
/// foo //~ ERROR unused doc comment
|
2017-07-15 17:17:35 -05:00
|
|
|
unsafe {}
|
2019-01-23 12:44:43 -06:00
|
|
|
|
2019-01-24 14:49:03 -06:00
|
|
|
#[doc = "foo"] //~ ERROR unused doc comment
|
|
|
|
#[doc = "bar"] //~ ERROR unused doc comment
|
2019-01-23 12:44:43 -06:00
|
|
|
3;
|
2019-01-24 14:49:03 -06:00
|
|
|
|
|
|
|
/// bar //~ ERROR unused doc comment
|
|
|
|
mac!();
|
|
|
|
|
|
|
|
let x = /** comment */ 47; //~ ERROR unused doc comment
|
|
|
|
|
|
|
|
/// dox //~ ERROR unused doc comment
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2017-07-01 18:37:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2017-07-15 17:17:35 -05:00
|
|
|
foo();
|
2017-12-29 12:25:40 -06:00
|
|
|
}
|