1
Fork 0
rust/src/test/ui/const-generics/const-param-before-other-params.rs

17 lines
649 B
Rust
Raw Normal View History

// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
fn bar<const X: (), 'a>(_: &'a ()) {
//[full]~^ ERROR lifetime parameters must be declared prior to const parameters
//[min]~^^ ERROR lifetime parameters must be declared prior to const parameters
//[min]~^^^ ERROR `()` is forbidden as the type of a const generic parameter
}
fn foo<const X: (), T>(_: &T) {}
//[min]~^ ERROR type parameters must be declared prior to const parameters
//[min]~^^ ERROR `()` is forbidden as the type of a const generic parameter
fn main() {}