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