File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
src/test/ui/const-generics Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ feature( const_generics) ]
2
+ //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
3
+
4
+ const fn const_u32_identity < const X : u32 > ( ) -> u32 {
5
+ //~^ ERROR const parameters are not permitted in `const fn`
6
+ //~^^ ERROR const generics in any position are currently unsupported
7
+ X
8
+ }
9
+
10
+ fn main ( ) {
11
+ println ! ( "{:?}" , const_u32_identity:: <18 >( ) ) ;
12
+ }
Original file line number Diff line number Diff line change
1
+ warning: the feature `const_generics` is incomplete and may cause the compiler to crash
2
+ --> $DIR/const-fn-with-const-param.rs:1:12
3
+ |
4
+ LL | #![feature(const_generics)]
5
+ | ^^^^^^^^^^^^^^
6
+
7
+ error: const parameters are not permitted in `const fn`
8
+ --> $DIR/const-fn-with-const-param.rs:4:1
9
+ |
10
+ LL | / const fn const_u32_identity<const X: u32>() -> u32 {
11
+ LL | | //~^ ERROR const parameters are not permitted in `const fn`
12
+ LL | | //~^^ ERROR const generics in any position are currently unsupported
13
+ LL | | X
14
+ LL | | }
15
+ | |_^
16
+
17
+ error: const generics in any position are currently unsupported
18
+ --> $DIR/const-fn-with-const-param.rs:4:35
19
+ |
20
+ LL | const fn const_u32_identity<const X: u32>() -> u32 {
21
+ | ^
22
+
23
+ error: aborting due to 2 previous errors
24
+
You can’t perform that action at this time.
0 commit comments