forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbind-by-move-neither-can-live-while-the-other-survives-1.stderr
71 lines (64 loc) · 2.66 KB
/
bind-by-move-neither-can-live-while-the-other-survives-1.stderr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
error: cannot move out of value because it is borrowed
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:14:14
|
LL | Some(ref _y @ _z) => {}
| ------^^^--
| | |
| | value moved into `_z` here
| value borrowed, by `_y`, here
error: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:21:14
|
LL | Some(_z @ ref _y) => {}
| --^^^------
| | |
| | value borrowed here after move
| value moved into `_z` here
| move occurs because `_z` has type `X` which does not implement the `Copy` trait
error: cannot move out of value because it is borrowed
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:28:14
|
LL | Some(ref mut _y @ _z) => {}
| ----------^^^--
| | |
| | value moved into `_z` here
| value borrowed, by `_y`, here
error: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:35:14
|
LL | Some(_z @ ref mut _y) => {}
| --^^^----------
| | |
| | value borrowed here after move
| value moved into `_z` here
| move occurs because `_z` has type `X` which does not implement the `Copy` trait
error[E0382]: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:14:14
|
LL | Some(ref _y @ _z) => {}
| ^^^^^^^^^--
| | |
| | value moved here
| value borrowed here after move
|
= note: move occurs because value has type `X`, which does not implement the `Copy` trait
help: borrow this field in the pattern to avoid moving `x.0`
|
LL | Some(ref _y @ ref _z) => {}
| ^^^
error[E0382]: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:28:14
|
LL | Some(ref mut _y @ _z) => {}
| ^^^^^^^^^^^^^--
| | |
| | value moved here
| value borrowed here after move
|
= note: move occurs because value has type `X`, which does not implement the `Copy` trait
help: borrow this field in the pattern to avoid moving `x.0`
|
LL | Some(ref mut _y @ ref _z) => {}
| ^^^
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0382`.