summary refs log tree commit diff
path: root/src/test/ui/const-generics/defaults/intermixed-lifetime.rs
blob: cc0d1c6c0c97cbcd79d60f2c71a25e5c5113a2c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// revisions: full min
// Checks that lifetimes cannot be interspersed between consts and types.
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]

struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
//~^ Error lifetime parameters must be declared prior to const parameters
//[min]~^^ Error type parameters must be declared prior to const parameters

struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
//[full]~^ Error lifetime parameters must be declared prior to type parameters
//[min]~^^ Error type parameters must be declared prior to const parameters
//[min]~| Error lifetime parameters must be declared prior to const parameters

fn main() {}