]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/argument_order.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.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 }