]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/macro_rules-braces.rs
2 #![cfg_attr(full, allow(incomplete_features))]
3 #![cfg_attr(full, feature(const_generics))]
4 #![cfg_attr(min, feature(min_const_generics))]
7 pub const P
: usize = 0;
12 fn test
<const N
: usize>() {
13 struct Foo
<const M
: usize>;
16 [u8; $x
] //[full]~ ERROR constant expression depends
21 [u8; { $x }
] //[full]~ ERROR constant expression depends
26 Foo
<$x
> //[full]~ ERROR constant expression depends
31 Foo
<{ $x }
> //[full]~ ERROR constant expression depends
37 let _
: foo
!({{ N }
}); //[min]~ ERROR generic parameters may not
41 let _
: bar
!({ N }
); //[min]~ ERROR generic parameters may not
46 let _
: baz
!({{ N }
}); //[min]~ ERROR generic parameters may not
48 let _
: baz
!({ m::P }
);
49 let _
: baz
!(m
::P
); //~ ERROR expressions must be enclosed in braces
51 let _
: biz
!({ N }
); //[min]~ ERROR generic parameters may not
65 let _
: foo
!({ 10 + 7 }
);
66 let _
: foo
!({{ 10 + 7 }
});
68 let _
: bar
!({ 10 + 7 }
);
69 let _
: baz
!(10 + 7); //~ ERROR expressions must be enclosed in braces
70 let _
: baz
!({ 10 + 7 }
);
71 let _
: baz
!({{ 10 + 7 }
});
73 let _
: biz
!({ 10 + 7 }
);