rust/src/test/ui/useless-comment.rs

46 lines
753 B
Rust
Raw Normal View History

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