Add const generics feature gate test
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
This commit is contained in:
parent
3991ba76ee
commit
8fd5979006
2 changed files with 31 additions and 0 deletions
6
src/test/ui/feature-gates/feature-gate-const_generics.rs
Normal file
6
src/test/ui/feature-gates/feature-gate-const_generics.rs
Normal 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() {}
|
||||
25
src/test/ui/feature-gates/feature-gate-const_generics.stderr
Normal file
25
src/test/ui/feature-gates/feature-gate-const_generics.stderr
Normal 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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue