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