fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
2.5 KiB66 linesraw
1error[E0658]: binding by-move and by-ref in the same pattern is unstable
2  --> $DIR/feature-gate-move_ref_pattern.rs:8:15
3   |
4LL |         Some((y, ref z)) => {}
5   |               ^  ----- by-ref pattern here
6   |               |
7   |               by-move pattern here
8   |
9   = note: see issue #68354 <https://github.com/rust-lang/rust/issues/68354> for more information
10   = help: add `#![feature(move_ref_pattern)]` to the crate attributes to enable
11
12error[E0658]: binding by-move and by-ref in the same pattern is unstable
13  --> $DIR/feature-gate-move_ref_pattern.rs:13:17
14   |
15LL |     let (ref a, b) = tup.clone();
16   |          -----  ^ by-move pattern here
17   |          |
18   |          by-ref pattern here
19   |
20   = note: see issue #68354 <https://github.com/rust-lang/rust/issues/68354> for more information
21   = help: add `#![feature(move_ref_pattern)]` to the crate attributes to enable
22
23error[E0658]: binding by-move and by-ref in the same pattern is unstable
24  --> $DIR/feature-gate-move_ref_pattern.rs:16:13
25   |
26LL |     let (a, mut b) = &tup;
27   |          -  ^^^^^ by-move pattern here
28   |          |
29   |          by-ref pattern here
30   |
31   = note: see issue #68354 <https://github.com/rust-lang/rust/issues/68354> for more information
32   = help: add `#![feature(move_ref_pattern)]` to the crate attributes to enable
33
34error[E0658]: binding by-move and by-ref in the same pattern is unstable
35  --> $DIR/feature-gate-move_ref_pattern.rs:20:10
36   |
37LL |     let (mut a, b) = &mut tup;
38   |          ^^^^^  - by-ref pattern here
39   |          |
40   |          by-move pattern here
41   |
42   = note: see issue #68354 <https://github.com/rust-lang/rust/issues/68354> for more information
43   = help: add `#![feature(move_ref_pattern)]` to the crate attributes to enable
44
45error[E0507]: cannot move out of a shared reference
46  --> $DIR/feature-gate-move_ref_pattern.rs:16:22
47   |
48LL |     let (a, mut b) = &tup;
49   |             -----    ^^^^
50   |             |
51   |             data moved here
52   |             move occurs because `b` has type `main::X`, which does not implement the `Copy` trait
53
54error[E0507]: cannot move out of a mutable reference
55  --> $DIR/feature-gate-move_ref_pattern.rs:20:22
56   |
57LL |     let (mut a, b) = &mut tup;
58   |          -----       ^^^^^^^^
59   |          |
60   |          data moved here
61   |          move occurs because `a` has type `main::X`, which does not implement the `Copy` trait
62
63error: aborting due to 6 previous errors
64
65Some errors have detailed explanations: E0507, E0658.
66For more information about an error, try `rustc --explain E0507`.