cg: add explicit test for const param promotion
This commit is contained in:
parent
12f0dba618
commit
c56add0dcb
11
src/test/ui/const-generics/promotion.rs
Normal file
11
src/test/ui/const-generics/promotion.rs
Normal 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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user