]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/match-guards-always-borrow.ast.nll.stderr
Update output for borrowck=migrate compare mode.
[rust.git] / src / test / ui / nll / match-guards-always-borrow.ast.nll.stderr
1 warning[E0507]: cannot move out of borrowed content
2   --> $DIR/match-guards-always-borrow.rs:23:13
3    |
4 LL |             (|| { let bar = foo; bar.take() })();
5    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
6    |
7    = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
8            It represents potential unsoundness in your code.
9            This warning will become a hard error in the future.
10
11 warning[E0507]: cannot move out of `foo`, as it is immutable for the pattern guard
12   --> $DIR/match-guards-always-borrow.rs:23:13
13    |
14 LL |             (|| { let bar = foo; bar.take() })();
15    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16    |             |
17    |             cannot move out of `foo`, as it is immutable for the pattern guard
18    |             cannot move
19    |
20    = note: variables bound in patterns are immutable until the end of the pattern guard
21    = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
22            It represents potential unsoundness in your code.
23            This warning will become a hard error in the future.
24
25 error: compilation successful
26   --> $DIR/match-guards-always-borrow.rs:57:1
27    |
28 LL | / fn main() { //[ast]~ ERROR compilation successful
29 LL | |     should_reject_destructive_mutate_in_guard();
30 LL | |     allow_mutate_in_arm_body();
31 LL | |     allow_move_into_arm_body();
32 LL | | }
33    | |_^
34
35 error: aborting due to previous error
36
37 For more information about this error, try `rustc --explain E0507`.