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:
Dylan DPC 2020-03-21 13:06:40 +01:00 committed by GitHub
commit 266801d806
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 84 additions and 37 deletions

View 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() { }

View 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