File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
src/test/ui/feature-gates Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ fn foo < const X : ( ) > ( ) { } //~ ERROR const generics are unstable
2
+ //~^ const generics in any position are currently unsupported
3
+
4
+ struct Foo < const X : usize > ( [ ( ) ; X ] ) ; //~ ERROR const generics are unstable
5
+
6
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0658]: const generics are unstable (see issue #44580)
2
+ --> $DIR/feature-gate-const_generics.rs:1:14
3
+ |
4
+ LL | fn foo<const X: ()>() {} //~ ERROR const generics are unstable
5
+ | ^
6
+ |
7
+ = help: add #![feature(const_generics)] to the crate attributes to enable
8
+
9
+ error[E0658]: const generics are unstable (see issue #44580)
10
+ --> $DIR/feature-gate-const_generics.rs:4:18
11
+ |
12
+ LL | struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable
13
+ | ^
14
+ |
15
+ = help: add #![feature(const_generics)] to the crate attributes to enable
16
+
17
+ error: const generics in any position are currently unsupported
18
+ --> $DIR/feature-gate-const_generics.rs:1:14
19
+ |
20
+ LL | fn foo<const X: ()>() {} //~ ERROR const generics are unstable
21
+ | ^
22
+
23
+ error: aborting due to 3 previous errors
24
+
25
+ For more information about this error, try `rustc --explain E0658`.
You can’t perform that action at this time.
0 commit comments