]> git.lizzy.rs Git - rust.git/blob - src/test/ui/access-mode-in-closures.nll.stderr
Regression test for issue #54477.
[rust.git] / src / test / ui / access-mode-in-closures.nll.stderr
1 error[E0507]: cannot move out of borrowed content
2   --> $DIR/access-mode-in-closures.rs:19:15
3    |
4 LL |         match *s { sty(v) => v } //~ ERROR cannot move out
5    |               ^^       - data moved here
6    |               |
7    |               cannot move out of borrowed content
8    |               help: consider removing the `*`: `s`
9    |
10 note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
11   --> $DIR/access-mode-in-closures.rs:19:24
12    |
13 LL |         match *s { sty(v) => v } //~ ERROR cannot move out
14    |                        ^
15
16 error[E0507]: cannot move out of `s.0` which is behind a `&` reference
17   --> $DIR/access-mode-in-closures.rs:19:24
18    |
19 LL |     let _foo = unpack(|s| {
20    |                        - help: consider changing this to be a mutable reference: `&mut sty`
21 LL |         // Test that `s` is moved here.
22 LL |         match *s { sty(v) => v } //~ ERROR cannot move out
23    |                        ^
24    |                        |
25    |                        cannot move out of `s.0` which is behind a `&` reference
26    |                        `s` is a `&` reference, so the data it refers to cannot be moved
27
28 error: aborting due to 2 previous errors
29
30 For more information about this error, try `rustc --explain E0507`.