Rollup merge of #70032 - lcnr:issue69970, r=varkor
put type params in front of const params in generics_of fixes #69970 r? @varkor
This commit is contained in:
commit
266801d806
4 changed files with 84 additions and 37 deletions
9
src/test/ui/const-generics/argument_order.rs
Normal file
9
src/test/ui/const-generics/argument_order.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![feature(const_generics)]
|
||||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
|
||||
|
||||
struct Bad<const N: usize, T> { //~ ERROR type parameters must be declared prior
|
||||
arr: [u8; { N }],
|
||||
another: T,
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
16
src/test/ui/const-generics/argument_order.stderr
Normal file
16
src/test/ui/const-generics/argument_order.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
error: type parameters must be declared prior to const parameters
|
||||
--> $DIR/argument_order.rs:4:28
|
||||
|
|
||||
LL | struct Bad<const N: usize, T> {
|
||||
| -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`
|
||||
|
||||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
|
||||
--> $DIR/argument_order.rs:1:12
|
||||
|
|
||||
LL | #![feature(const_generics)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue