require type defaults to be after const generic parameters

as if this is currently possible. HA!
This commit is contained in:
Bastian Kauschke 2020-07-22 22:58:54 +02:00
parent 9e92106d45
commit a95e6bb916
3 changed files with 46 additions and 6 deletions

View file

@ -0,0 +1,8 @@
#![feature(const_generics)] //~ WARN the feature `const_generics` is incomplete
struct A<T = u32, const N: usize> {
//~^ ERROR type parameters with a default must be trailing
arg: T,
}
fn main() {}

View file

@ -0,0 +1,19 @@
error: type parameters with a default must be trailing
--> $DIR/wrong-order.rs:3:10
|
LL | struct A<T = u32, const N: usize> {
| ^
|
= note: using type defaults and const parameters in the same parameter listing is currently not possible
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/wrong-order.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error: aborting due to previous error; 1 warning emitted