]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-49934.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-49934.rs
1 #![feature(stmt_expr_attributes)]
2
3 fn main() {
4 // fold_stmt (Item)
5 #[allow(dead_code)]
6 #[derive(Debug)] // should not warn
7 struct Foo;
8
9 // fold_stmt (Mac)
10 #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
11 println!("Hello, world!");
12
13 // fold_stmt (Semi)
14 #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
15 "Hello, world!";
16
17 // fold_stmt (Local)
18 #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
19 let _ = "Hello, world!";
20
21 // visit_expr
22 let _ = #[derive(Debug)] "Hello, world!";
23 //~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
24
25 let _ = [
26 // filter_map_expr
27 #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
28 "Hello, world!",
29 ];
30 }