rust/tests/ui/const-generics/defaults/intermixed-lifetime.rs

10 lines
360 B
Rust
Raw Normal View History

// Checks that lifetimes cannot be interspersed between consts and types.
struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
2022-09-09 07:28:57 -05:00
//~^ ERROR lifetime parameters must be declared prior to type and const parameters
struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
2022-09-09 07:28:57 -05:00
//~^ ERROR lifetime parameters must be declared prior to type and const parameters
fn main() {}