]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/argument_order.rs
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / const-generics / argument_order.rs
1 // revisions: full min
2 #![cfg_attr(full, feature(const_generics))]
3 #![cfg_attr(full, allow(incomplete_features))]
4
5 struct Bad<const N: usize, T> {
6     //[min]~^ ERROR type parameters must be declared prior to const parameters
7     arr: [u8; { N }],
8     another: T,
9 }
10
11 struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
12     //~^ ERROR lifetime parameters must be declared prior
13     //[min]~^^ ERROR type parameters must be declared prior to const parameters
14     a: &'a T,
15     b: &'b U,
16 }
17
18 fn main() {
19     let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
20     //~^ ERROR lifetime provided when a type was expected
21  }