File tree 2 files changed +31
-0
lines changed
src/test/ui/const-generics
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ feature( adt_const_params) ]
2
+ //~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
3
+
4
+ #[ derive( PartialEq , Eq ) ]
5
+ enum Nat {
6
+ Z ,
7
+ S ( Box < Nat > ) ,
8
+ }
9
+
10
+ fn foo < const N : Nat > ( ) { }
11
+ //~^ ERROR `Box<Nat>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
12
+
13
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
2
+ --> $DIR/issue-80471.rs:1:12
3
+ |
4
+ LL | #![feature(adt_const_params)]
5
+ | ^^^^^^^^^^^^^^^^
6
+ |
7
+ = note: `#[warn(incomplete_features)]` on by default
8
+ = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
9
+
10
+ error[E0741]: `Box<Nat>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
11
+ --> $DIR/issue-80471.rs:10:17
12
+ |
13
+ LL | fn foo<const N: Nat>() {}
14
+ | ^^^
15
+
16
+ error: aborting due to previous error; 1 warning emitted
17
+
18
+ For more information about this error, try `rustc --explain E0741`.
You can’t perform that action at this time.
0 commit comments