]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-83760.stderr
Rollup merge of #101675 - beetrees:set-times-no-panic, r=joshtriplett
[rust.git] / src / test / ui / borrowck / issue-83760.stderr
1 error[E0382]: use of moved value
2   --> $DIR/issue-83760.rs:5:20
3    |
4 LL |     while let Some(foo) = val {
5    |                    ^^^ value moved here, in previous iteration of loop
6 LL |         if true {
7 LL |             val = None;
8    |             ---------- this reinitialization might get skipped
9    |
10    = note: move occurs because value has type `Struct`, which does not implement the `Copy` trait
11
12 error[E0382]: use of moved value: `foo`
13   --> $DIR/issue-83760.rs:21:14
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
19 LL |     if true {
20 LL |         foo = Some(Struct);
21    |         ------------------ this reinitialization might get skipped
22 ...
23 LL |     let _y = foo;
24    |              ^^^ value used here after move
25    |
26 note: this function takes ownership of the receiver `self`, which moves `foo`
27   --> $SRC_DIR/core/src/option.rs:LL:COL
28    |
29 LL |     pub const fn unwrap(self) -> T {
30    |                         ^^^^
31
32 error[E0382]: use of moved value: `foo`
33   --> $DIR/issue-83760.rs:37:14
34    |
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
39 ...
40 LL |     let _y = foo;
41    |              ^^^ value used here after move
42    |
43 note: these 3 reinitializations and 1 other might get skipped
44   --> $DIR/issue-83760.rs:30:9
45    |
46 LL |         foo = Some(Struct);
47    |         ^^^^^^^^^^^^^^^^^^
48 LL |     } else if true {
49 LL |         foo = Some(Struct);
50    |         ^^^^^^^^^^^^^^^^^^
51 LL |     } else if true {
52 LL |         foo = Some(Struct);
53    |         ^^^^^^^^^^^^^^^^^^
54 note: this function takes ownership of the receiver `self`, which moves `foo`
55   --> $SRC_DIR/core/src/option.rs:LL:COL
56    |
57 LL |     pub const fn unwrap(self) -> T {
58    |                         ^^^^
59
60 error: aborting due to 3 previous errors
61
62 For more information about this error, try `rustc --explain E0382`.