rust/src/test/ui/const-generics/argument_order.rs

20 lines
538 B
Rust
Raw Normal View History

#![feature(const_generics)]
2020-04-22 03:21:32 -05:00
//~^ WARN the feature `const_generics` is incomplete
struct Bad<const N: usize, T> { //~ ERROR type parameters must be declared prior
arr: [u8; { N }],
another: T,
}
2020-07-23 06:19:35 -05:00
struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
//~^ ERROR type parameters must be declared prior
//~| ERROR lifetime parameters must be declared prior
a: &'a T,
b: &'b U,
}
2020-07-23 07:30:01 -05:00
fn main() {
let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
//~^ ERROR lifetime provided when a type was expected
}