Rollup merge of #78996 - lcnr:cg-promotion, r=RalfJung

add explicit test for const param promotion

r? `@RalfJung`
This commit is contained in:
Guillaume Gomez 2020-11-13 15:26:20 +01:00 committed by GitHub
commit 7ea8e32adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}