]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/argument_order.rs
Auto merge of #76157 - ArekPiekarz:const_caller_location_tracking_issue, r=joshtriplett
[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 #![cfg_attr(min, feature(min_const_generics))]
5
6 struct Bad<const N: usize, T> {
7     //[min]~^ ERROR type parameters must be declared prior to const parameters
8     arr: [u8; { N }],
9     another: T,
10 }
11
12 struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
13     //~^ ERROR lifetime parameters must be declared prior
14     //[min]~^^ ERROR type parameters must be declared prior to const parameters
15     a: &'a T,
16     b: &'b U,
17 }
18
19 fn main() {
20     let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
21     //~^ ERROR lifetime provided when a type was expected
22  }