]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-49934.rs
Add 'src/tools/clippy/' from commit 'd2708873ef711ec8ab45df1e984ecf24a96cd369'
[rust.git] / src / test / ui / issues / issue-49934.rs
1 // check-pass
2
3 #![feature(stmt_expr_attributes)]
4 #![warn(unused_attributes)] //~ NOTE the lint level is defined here
5
6 fn main() {
7     // fold_stmt (Item)
8     #[allow(dead_code)]
9     #[derive(Debug)] // should not warn
10     struct Foo;
11
12     // fold_stmt (Mac)
13     #[derive(Debug)]
14     //~^ WARN `#[derive]` does nothing on macro invocations
15     //~| NOTE this may become a hard error in a future release
16     println!("Hello, world!");
17
18     // fold_stmt (Semi)
19     #[derive(Debug)] //~ WARN unused attribute
20     "Hello, world!";
21
22     // fold_stmt (Local)
23     #[derive(Debug)] //~ WARN unused attribute
24     let _ = "Hello, world!";
25
26     // visit_expr
27     let _ = #[derive(Debug)] "Hello, world!";
28     //~^ WARN unused attribute
29
30     let _ = [
31         // filter_map_expr
32         #[derive(Debug)] //~ WARN unused attribute
33         "Hello, world!"
34     ];
35 }