2 #![cfg_attr(full, allow(incomplete_features))]
3 #![cfg_attr(full, feature(const_generics))]
6 pub const P: usize = 0;
11 fn test<const N: usize>() {
12 struct Foo<const M: usize>;
15 [u8; $x] //[full]~ ERROR constant expression depends
20 [u8; { $x }] //[full]~ ERROR constant expression depends
25 Foo<$x> //[full]~ ERROR constant expression depends
30 Foo<{ $x }> //[full]~ ERROR constant expression depends
36 let _: foo!({{ N }}); //[min]~ ERROR generic parameters may not
40 let _: bar!({ N }); //[min]~ ERROR generic parameters may not
45 let _: baz!({{ N }}); //[min]~ ERROR generic parameters may not
47 let _: baz!({ m::P });
48 let _: baz!(m::P); //~ ERROR expressions must be enclosed in braces
50 let _: biz!({ N }); //[min]~ ERROR generic parameters may not
64 let _: foo!({ 10 + 7 });
65 let _: foo!({{ 10 + 7 }});
67 let _: bar!({ 10 + 7 });
68 let _: baz!(10 + 7); //~ ERROR expressions must be enclosed in braces
69 let _: baz!({ 10 + 7 });
70 let _: baz!({{ 10 + 7 }});
72 let _: biz!({ 10 + 7 });