]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-49934.rs
Pass cflags rather than cxxflags to LLVM as CMAKE_C_FLAGS
[rust.git] / src / test / ui / issues / issue-49934.rs
1 // compile-pass
2
3 #![feature(stmt_expr_attributes)]
4 #![warn(unused_attributes)] //~ NOTE lint level defined here
5
6 fn foo<#[derive(Debug)] T>() { //~ WARN unused attribute
7     match 0 {
8         #[derive(Debug)] //~ WARN unused attribute
9         _ => (),
10     }
11 }
12
13 fn main() {
14     // fold_stmt (Item)
15     #[allow(dead_code)]
16     #[derive(Debug)] // should not warn
17     struct Foo;
18
19     // fold_stmt (Mac)
20     #[derive(Debug)]
21     //~^ WARN `#[derive]` does nothing on macro invocations
22     //~| NOTE this may become a hard error in a future release
23     println!("Hello, world!");
24
25     // fold_stmt (Semi)
26     #[derive(Debug)] //~ WARN unused attribute
27     "Hello, world!";
28
29     // fold_stmt (Local)
30     #[derive(Debug)] //~ WARN unused attribute
31     let _ = "Hello, world!";
32
33     // visit_expr
34     let _ = #[derive(Debug)] "Hello, world!";
35     //~^ WARN unused attribute
36
37     let _ = [
38         // filter_map_expr
39         #[derive(Debug)] //~ WARN unused attribute
40         "Hello, world!"
41     ];
42 }