fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
2.1 KiB56 linesraw
1error[E0009]: cannot bind by-move and by-ref in the same pattern
2  --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:12:23
3   |
4LL |         Some(ref _y @ _z) => { },
5   |              ---------^^
6   |              |        |
7   |              |        by-move pattern here
8   |              by-ref pattern here
9
10error[E0007]: cannot bind by-move with sub-bindings
11  --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:18:14
12   |
13LL |         Some(_z @ ref _y) => { },
14   |              ^^^^^^^^^^^ binds an already bound by-move value by moving it
15
16error[E0009]: cannot bind by-move and by-ref in the same pattern
17  --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:25:27
18   |
19LL |         Some(ref mut _y @ _z) => { },
20   |              -------------^^
21   |              |            |
22   |              |            by-move pattern here
23   |              by-ref pattern here
24
25error[E0007]: cannot bind by-move with sub-bindings
26  --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:31:14
27   |
28LL |         Some(_z @ ref mut _y) => { },
29   |              ^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
30
31error[E0382]: borrow of moved value
32  --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:18:19
33   |
34LL |         Some(_z @ ref _y) => { },
35   |              -----^^^^^^
36   |              |    |
37   |              |    value borrowed here after move
38   |              value moved here
39   |
40   = note: move occurs because value has type `X`, which does not implement the `Copy` trait
41
42error[E0382]: borrow of moved value
43  --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:31:19
44   |
45LL |         Some(_z @ ref mut _y) => { },
46   |              -----^^^^^^^^^^
47   |              |    |
48   |              |    value borrowed here after move
49   |              value moved here
50   |
51   = note: move occurs because value has type `X`, which does not implement the `Copy` trait
52
53error: aborting due to 6 previous errors
54
55Some errors have detailed explanations: E0007, E0009, E0382.
56For more information about an error, try `rustc --explain E0007`.