Add const generics feature gate test

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
This commit is contained in:
varkor 2019-02-05 16:58:53 +01:00
parent 3991ba76ee
commit 8fd5979006
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,6 @@
fn foo<const X: ()>() {} //~ ERROR const generics are unstable
//~^ const generics in any position are currently unsupported
struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable
fn main() {}

View file

@ -0,0 +1,25 @@
error[E0658]: const generics are unstable (see issue #44580)
--> $DIR/feature-gate-const_generics.rs:1:14
|
LL | fn foo<const X: ()>() {} //~ ERROR const generics are unstable
| ^
|
= help: add #![feature(const_generics)] to the crate attributes to enable
error[E0658]: const generics are unstable (see issue #44580)
--> $DIR/feature-gate-const_generics.rs:4:18
|
LL | struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable
| ^
|
= help: add #![feature(const_generics)] to the crate attributes to enable
error: const generics in any position are currently unsupported
--> $DIR/feature-gate-const_generics.rs:1:14
|
LL | fn foo<const X: ()>() {} //~ ERROR const generics are unstable
| ^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.