fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1008 B28 linesraw
1error[E0007]: cannot bind by-move with sub-bindings
2  --> $DIR/E0007.rs:4:9
3   |
4LL |         op_string @ Some(s) => {},
5   |         ^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
6
7error[E0303]: pattern bindings are not allowed after an `@`
8  --> $DIR/E0007.rs:4:26
9   |
10LL |         op_string @ Some(s) => {},
11   |                          ^ not allowed after `@`
12
13error[E0382]: use of moved value
14  --> $DIR/E0007.rs:4:26
15   |
16LL |     let x = Some("s".to_string());
17   |         - move occurs because `x` has type `std::option::Option<std::string::String>`, which does not implement the `Copy` trait
18LL |     match x {
19LL |         op_string @ Some(s) => {},
20   |         -----------------^-
21   |         |                |
22   |         |                value used here after move
23   |         value moved here
24
25error: aborting due to 3 previous errors
26
27Some errors have detailed explanations: E0007, E0303, E0382.
28For more information about an error, try `rustc --explain E0007`.