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