mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
add more complex param order test
This commit is contained in:
parent
6dc6a1f947
commit
9910f156df
@ -6,4 +6,11 @@ struct Bad<const N: usize, T> { //~ ERROR type parameters must be declared prior
|
|||||||
another: T,
|
another: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
@ -4,6 +4,18 @@ error: type parameters must be declared prior to const parameters
|
|||||||
LL | struct Bad<const N: usize, T> {
|
LL | struct Bad<const N: usize, T> {
|
||||||
| -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`
|
| -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`
|
||||||
|
|
||||||
|
error: lifetime parameters must be declared prior to const parameters
|
||||||
|
--> $DIR/argument_order.rs:9:32
|
||||||
|
|
|
||||||
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
|
||||||
|
| -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>`
|
||||||
|
|
||||||
|
error: type parameters must be declared prior to const parameters
|
||||||
|
--> $DIR/argument_order.rs:9:36
|
||||||
|
|
|
||||||
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
|
||||||
|
| ---------------------^----------------------^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>`
|
||||||
|
|
||||||
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
|
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||||
--> $DIR/argument_order.rs:1:12
|
--> $DIR/argument_order.rs:1:12
|
||||||
|
|
|
|
||||||
@ -13,5 +25,5 @@ LL | #![feature(const_generics)]
|
|||||||
= note: `#[warn(incomplete_features)]` on by default
|
= note: `#[warn(incomplete_features)]` on by default
|
||||||
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
|
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
|
||||||
|
|
||||||
error: aborting due to previous error; 1 warning emitted
|
error: aborting due to 3 previous errors; 1 warning emitted
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user