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
11 help: borrow this binding in the pattern to avoid moving the value
13 LL | while let Some(ref foo) = val {
16 error[E0382]: use of moved value: `foo`
17 --> $DIR/issue-83760.rs:21:14
19 LL | let mut foo = Some(Struct);
20 | ------- move occurs because `foo` has type `Option<Struct>`, which does not implement the `Copy` trait
21 LL | let _x = foo.unwrap();
22 | -------- `foo` moved due to this method call
24 LL | foo = Some(Struct);
25 | ------------------ this reinitialization might get skipped
28 | ^^^ value used here after move
30 note: `Option::<T>::unwrap` takes ownership of the receiver `self`, which moves `foo`
31 --> $SRC_DIR/core/src/option.rs:LL:COL
33 error[E0382]: use of moved value: `foo`
34 --> $DIR/issue-83760.rs:37:14
36 LL | let mut foo = Some(Struct);
37 | ------- move occurs because `foo` has type `Option<Struct>`, which does not implement the `Copy` trait
38 LL | let _x = foo.unwrap();
39 | -------- `foo` moved due to this method call
42 | ^^^ value used here after move
44 note: these 3 reinitializations and 1 other might get skipped
45 --> $DIR/issue-83760.rs:30:9
47 LL | foo = Some(Struct);
50 LL | foo = Some(Struct);
53 LL | foo = Some(Struct);
55 note: `Option::<T>::unwrap` takes ownership of the receiver `self`, which moves `foo`
56 --> $SRC_DIR/core/src/option.rs:LL:COL
58 error: aborting due to 3 previous errors
60 For more information about this error, try `rustc --explain E0382`.