1 error[E0382]: use of moved value
2 --> $DIR/issue-83760.rs:5:20
4 LL | while let Some(foo) = val {
5 | ^^^ value moved here, in previous iteration of loop
8 | ---------- this reinitialization might get skipped
10 = note: move occurs because value has type `Struct`, which does not implement the `Copy` trait
12 error[E0382]: use of moved value: `foo`
13 --> $DIR/issue-83760.rs:21:14
15 LL | let mut foo = Some(Struct);
16 | ------- move occurs because `foo` has type `Option<Struct>`, which does not implement the `Copy` trait
17 LL | let _x = foo.unwrap();
18 | -------- `foo` moved due to this method call
20 LL | foo = Some(Struct);
21 | ------------------ this reinitialization might get skipped
24 | ^^^ value used here after move
26 note: this function takes ownership of the receiver `self`, which moves `foo`
27 --> $SRC_DIR/core/src/option.rs:LL:COL
29 LL | pub const fn unwrap(self) -> T {
32 error[E0382]: use of moved value: `foo`
33 --> $DIR/issue-83760.rs:37:14
35 LL | let mut foo = Some(Struct);
36 | ------- move occurs because `foo` has type `Option<Struct>`, which does not implement the `Copy` trait
37 LL | let _x = foo.unwrap();
38 | -------- `foo` moved due to this method call
41 | ^^^ value used here after move
43 note: these 3 reinitializations and 1 other might get skipped
44 --> $DIR/issue-83760.rs:30:9
46 LL | foo = Some(Struct);
49 LL | foo = Some(Struct);
52 LL | foo = Some(Struct);
54 note: this function takes ownership of the receiver `self`, which moves `foo`
55 --> $SRC_DIR/core/src/option.rs:LL:COL
57 LL | pub const fn unwrap(self) -> T {
60 error: aborting due to 3 previous errors
62 For more information about this error, try `rustc --explain E0382`.