]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/move-error-in-promoted.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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 }