]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/rfc-2203-const-array-repeat-exprs/migrate-fail.rs
Check that value is explicitly none
[rust.git] / src / test / ui / consts / rfc-2203-const-array-repeat-exprs / migrate-fail.rs
1 // ignore-compare-mode-nll
2 // compile-flags: -Z borrowck=migrate
3 #![feature(const_in_array_repeat_expressions)]
4 #![allow(warnings)]
5
6 // Some type that is not copyable.
7 struct Bar;
8
9 mod non_constants {
10     use Bar;
11
12     fn no_impl_copy_empty_value_multiple_elements() {
13         let x = None;
14         let arr: [Option<Bar>; 2] = [x; 2];
15         //~^ ERROR the trait bound `Option<Bar>: Copy` is not satisfied [E0277]
16     }
17
18     fn no_impl_copy_value_multiple_elements() {
19         let x = Some(Bar);
20         let arr: [Option<Bar>; 2] = [x; 2];
21         //~^ ERROR the trait bound `Option<Bar>: Copy` is not satisfied [E0277]
22     }
23 }
24
25 fn main() {}