We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 22cc878 + c56add0 commit 7ea8e32Copy full SHA for 7ea8e32
src/test/ui/const-generics/promotion.rs
@@ -0,0 +1,11 @@
1
+// run-pass
2
+// tests that promoting expressions containing const parameters is allowed.
3
+#![feature(min_const_generics)]
4
+
5
+fn promotion_test<const N: usize>() -> &'static usize {
6
+ &(3 + N)
7
+}
8
9
+fn main() {
10
+ assert_eq!(promotion_test::<13>(), &16);
11
0 commit comments