]> git.lizzy.rs Git - rust.git/blob - tests/ui/moves/issue-99470-move-out-of-some.stderr
Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / tests / ui / moves / issue-99470-move-out-of-some.stderr
1 error[E0507]: cannot move out of `x` as enum variant `Some` which is behind a shared reference
2   --> $DIR/issue-99470-move-out-of-some.rs:4:11
3    |
4 LL |     match x {
5    |           ^
6 LL |
7 LL |         &Some(_y) => (),
8    |               --
9    |               |
10    |               data moved here
11    |               move occurs because `_y` has type `Box<i32>`, which does not implement the `Copy` trait
12    |
13 help: consider removing the borrow
14    |
15 LL -         &Some(_y) => (),
16 LL +         Some(_y) => (),
17    |
18
19 error: aborting due to previous error
20
21 For more information about this error, try `rustc --explain E0507`.