fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.9 KiB35 linesraw
1error[E0507]: cannot move out of `selection.1` which is behind a shared reference
2  --> $DIR/option-content-move.rs:9:20
3   |
4LL |                 if selection.1.unwrap().contains(selection.0) {
5   |                    ^^^^^^^^^^^ -------- `selection.1` moved due to this method call
6   |                    |
7   |                    help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
8   |                    move occurs because `selection.1` has type `Option<String>`, which does not implement the `Copy` trait
9   |
10note: `Option::<T>::unwrap` takes ownership of the receiver `self`, which moves `selection.1`
11  --> $SRC_DIR/core/src/option.rs:LL:COL
12help: you can `clone` the value and consume it, but this might not be your desired behavior
13   |
14LL |                 if selection.1.clone().unwrap().contains(selection.0) {
15   |                               ++++++++
16
17error[E0507]: cannot move out of `selection.1` which is behind a shared reference
18  --> $DIR/option-content-move.rs:27:20
19   |
20LL |                 if selection.1.unwrap().contains(selection.0) {
21   |                    ^^^^^^^^^^^ -------- `selection.1` moved due to this method call
22   |                    |
23   |                    help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
24   |                    move occurs because `selection.1` has type `Result<String, String>`, which does not implement the `Copy` trait
25   |
26note: `Result::<T, E>::unwrap` takes ownership of the receiver `self`, which moves `selection.1`
27  --> $SRC_DIR/core/src/result.rs:LL:COL
28help: you can `clone` the value and consume it, but this might not be your desired behavior
29   |
30LL |                 if selection.1.clone().unwrap().contains(selection.0) {
31   |                               ++++++++
32
33error: aborting due to 2 previous errors
34
35For more information about this error, try `rustc --explain E0507`.