]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/option-content-move.stderr
Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu
[rust.git] / tests / ui / suggestions / option-content-move.stderr
1 error[E0507]: cannot move out of `selection.1` which is behind a shared reference
2   --> $DIR/option-content-move.rs:9:20
3    |
4 LL |                 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    |
10 note: `Option::<T>::unwrap` takes ownership of the receiver `self`, which moves `selection.1`
11   --> $SRC_DIR/core/src/option.rs:LL:COL
12 help: you can `clone` the value and consume it, but this might not be your desired behavior
13    |
14 LL |                 if selection.1.clone().unwrap().contains(selection.0) {
15    |                                ++++++++
16
17 error[E0507]: cannot move out of `selection.1` which is behind a shared reference
18   --> $DIR/option-content-move.rs:27:20
19    |
20 LL |                 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    |
26 note: `Result::<T, E>::unwrap` takes ownership of the receiver `self`, which moves `selection.1`
27   --> $SRC_DIR/core/src/result.rs:LL:COL
28 help: you can `clone` the value and consume it, but this might not be your desired behavior
29    |
30 LL |                 if selection.1.clone().unwrap().contains(selection.0) {
31    |                                ++++++++
32
33 error: aborting due to 2 previous errors
34
35 For more information about this error, try `rustc --explain E0507`.