We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9e8edc8 + 78498d0 commit 8998e31Copy full SHA for 8998e31
src/test/ui/const-generics/issues/issue-80062.rs
@@ -0,0 +1,10 @@
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() {}
src/test/ui/const-generics/issues/issue-80062.stderr
@@ -0,0 +1,11 @@
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-80062.rs:6:23
+ |
+LL | let _: [u8; sof::<T>()];
+ | ^ cannot perform const operation using `T`
+ = note: type parameters may not be used in const expressions
+ = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+error: aborting due to previous error
11
0 commit comments