Skip to content

Commit c56add0

Browse files
committed
cg: add explicit test for const param promotion
1 parent 12f0dba commit c56add0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
+11
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)