fork/rust

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

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

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