]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/option-content-move.stderr
Rollup merge of #105230 - cjgillot:issue-104312, r=petrochenkov
[rust.git] / src / test / 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: this function takes ownership of the receiver `self`, which moves `selection.1`
11   --> $SRC_DIR/core/src/option.rs:LL:COL
12    |
13 LL |     pub const fn unwrap(self) -> T {
14    |                         ^^^^
15
16 error[E0507]: cannot move out of `selection.1` which is behind a shared reference
17   --> $DIR/option-content-move.rs:27:20
18    |
19 LL |                 if selection.1.unwrap().contains(selection.0) {
20    |                    ^^^^^^^^^^^ -------- `selection.1` moved due to this method call
21    |                    |
22    |                    help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
23    |                    move occurs because `selection.1` has type `Result<String, String>`, which does not implement the `Copy` trait
24    |
25 note: this function takes ownership of the receiver `self`, which moves `selection.1`
26   --> $SRC_DIR/core/src/result.rs:LL:COL
27    |
28 LL |     pub fn unwrap(self) -> T
29    |                   ^^^^
30
31 error: aborting due to 2 previous errors
32
33 For more information about this error, try `rustc --explain E0507`.