File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
src/test/ui/const-generics/issues Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ // Regression test for issue #80062 (fixed by `min_const_generics`)
2+
3+ fn sof < T > ( ) -> T { unimplemented ! ( ) }
4+
5+ fn test < T > ( ) {
6+ let _: [ u8 ; sof :: < T > ( ) ] ;
7+ //~^ ERROR generic parameters may not be used in const operations
8+ }
9+
10+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: generic parameters may not be used in const operations
2+ --> $DIR/issue-80062.rs:6:23
3+ |
4+ LL | let _: [u8; sof::<T>()];
5+ | ^ cannot perform const operation using `T`
6+ |
7+ = note: type parameters may not be used in const expressions
8+ = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
9+
10+ error: aborting due to previous error
11+
You can’t perform that action at this time.
0 commit comments