]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/move-error-in-promoted.rs
New upstream version 1.45.0+dfsg1
[rustc.git] / src / test / ui / borrowck / move-error-in-promoted.rs
1 // Regression test for #70934
2
3 fn f() {
4 const C: [S2; 1] = [S2];
5 let _ = S1(C[0]).clone();
6 //~^ ERROR cannot move out of type `[S2; 1]`
7 }
8
9 #[derive(Clone)]
10 struct S1(S2);
11
12 #[derive(Clone)]
13 struct S2;
14
15 fn main() {
16 f();
17 }