]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-49934.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / issues / issue-49934.rs
CommitLineData
83c7162d 1#![feature(stmt_expr_attributes)]
0531ce1d 2
0531ce1d
XL
3fn main() {
4 // fold_stmt (Item)
5 #[allow(dead_code)]
6 #[derive(Debug)] // should not warn
7 struct Foo;
8
9 // fold_stmt (Mac)
6a06907d 10 #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
0531ce1d
XL
11 println!("Hello, world!");
12
13 // fold_stmt (Semi)
6a06907d 14 #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
0531ce1d
XL
15 "Hello, world!";
16
17 // fold_stmt (Local)
6a06907d 18 #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
0531ce1d
XL
19 let _ = "Hello, world!";
20
9fa01778 21 // visit_expr
83c7162d 22 let _ = #[derive(Debug)] "Hello, world!";
6a06907d 23 //~^ ERROR `derive` may only be applied to structs, enums and unions
83c7162d 24
0531ce1d 25 let _ = [
9fa01778 26 // filter_map_expr
6a06907d
XL
27 #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions
28 "Hello, world!",
0531ce1d
XL
29 ];
30}