]> git.lizzy.rs Git - rust.git/blob - tests/ui/moves/move-into-dead-array-1.rs
Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / tests / ui / moves / move-into-dead-array-1.rs
1 // Ensure that we cannot move into an uninitialized fixed-size array.
2
3 struct D { _x: u8 }
4
5 fn d() -> D { D { _x: 0 } }
6
7 fn main() {
8     foo(1);
9     foo(3);
10 }
11
12 fn foo(i: usize) {
13     let mut a: [D; 4];
14     a[i] = d(); //~ ERROR E0381
15 }