Skip to content

Commit 7ea8e32

Browse files
Rollup merge of rust-lang#78996 - lcnr:cg-promotion, r=RalfJung
add explicit test for const param promotion r? `@RalfJung`
2 parents 22cc878 + c56add0 commit 7ea8e32

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)