]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/move-error-in-promoted.rs
Auto merge of #95474 - oli-obk:tait_ub, r=jackh726
[rust.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 }