]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-blocks/fn-call-in-const.rs
Remove const_in_array_rep_expr
[rust.git] / src / test / ui / consts / const-blocks / fn-call-in-const.rs
1 // run-pass
2
3 #![feature(inline_const)]
4 #![allow(unused, incomplete_features)]
5
6 // Some type that is not copyable.
7 struct Bar;
8
9 const fn type_no_copy() -> Option<Bar> {
10     None
11 }
12
13 const fn type_copy() -> u32 {
14     3
15 }
16
17 const _: [u32; 2] = [type_copy(); 2];
18
19 // This is allowed because all promotion contexts use the explicit rules for promotability when
20 // inside an explicit const context.
21 const _: [Option<Bar>; 2] = [const { type_no_copy() }; 2];
22
23 fn main() {}