cg: add explicit test for const param promotion

This commit is contained in:
Bastian Kauschke 2020-11-12 19:20:47 +01:00
parent 12f0dba618
commit c56add0dcb

View File

@ -0,0 +1,11 @@
// run-pass
// tests that promoting expressions containing const parameters is allowed.
#![feature(min_const_generics)]
fn promotion_test<const N: usize>() -> &'static usize {
&(3 + N)
}
fn main() {
assert_eq!(promotion_test::<13>(), &16);
}