1 #![feature(rustc_attrs)]
3 #[rustc_legacy_const_generics(0)] //~ ERROR #[rustc_legacy_const_generics] must have one index for
6 #[rustc_legacy_const_generics(1)] //~ ERROR index exceeds number of arguments
7 fn foo2<const X: usize>() {}
9 #[rustc_legacy_const_generics(2)] //~ ERROR index exceeds number of arguments
10 fn foo3<const X: usize>(_: u8) {}
12 #[rustc_legacy_const_generics(a)] //~ ERROR arguments should be non-negative integers
13 fn foo4<const X: usize>() {}
15 #[rustc_legacy_const_generics(1, a, 2, b)] //~ ERROR arguments should be non-negative integers
16 fn foo5<const X: usize, const Y: usize, const Z: usize, const W: usize>() {}
18 #[rustc_legacy_const_generics(0)] //~ ERROR attribute should be applied to a function
21 #[rustc_legacy_const_generics(0usize)] //~ ERROR suffixed literals are not allowed in attributes
22 fn foo6<const X: usize>() {}
25 #[rustc_legacy_const_generics(1)] //~ ERROR attribute should be applied to a function
26 fn foo7<const X: usize>(); //~ ERROR foreign items may not have const parameters
29 #[rustc_legacy_const_generics(0)] //~ ERROR #[rustc_legacy_const_generics] functions must only have
33 #[rustc_legacy_const_generics(0)] //~ ERROR attribute should be applied to a function
34 fn foo9<const X: usize>() {}
37 #[rustc_legacy_const_generics] //~ ERROR malformed `rustc_legacy_const_generics` attribute
40 #[rustc_legacy_const_generics = 1] //~ ERROR malformed `rustc_legacy_const_generics` attribute