]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/rfc-2203-const-array-repeat-exprs/fn-call-in-non-const.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / consts / rfc-2203-const-array-repeat-exprs / fn-call-in-non-const.rs
1 #![feature(const_in_array_repeat_expressions)]
2
3 // Some type that is not copyable.
4 struct Bar;
5
6 const fn no_copy() -> Option<Bar> {
7 None
8 }
9
10 const fn copy() -> u32 {
11 3
12 }
13
14 fn main() {
15 let _: [u32; 2] = [copy(); 2];
16 let _: [Option<Bar>; 2] = [no_copy(); 2];
17 //~^ ERROR the trait bound `std::option::Option<Bar>: std::marker::Copy` is not satisfied
18 }