rust/tests/ui/lint/unused/useless-comment.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
753 B
Rust
Raw Normal View History

#![feature(stmt_expr_attributes)]
2018-05-18 17:13:53 -05:00
#![deny(unused_doc_comments)]
2017-07-15 17:17:35 -05:00
macro_rules! mac {
() => {}
}
/// foo //~ ERROR unused doc comment
mac!();
2017-07-15 17:17:35 -05:00
fn foo() {
/// a //~ ERROR unused doc comment
2017-07-15 17:17:35 -05:00
let x = 12;
/// multi-line //~ unused doc comment
/// doc comment
/// that is unused
2017-07-15 17:17:35 -05:00
match x {
/// c //~ ERROR unused doc comment
2017-07-15 17:17:35 -05:00
1 => {},
_ => {}
}
2017-07-15 17:17:35 -05:00
/// foo //~ ERROR unused doc comment
2017-07-15 17:17:35 -05: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-15 17:17:35 -05:00
foo();
}