summary refs log tree commit diff
path: root/src/test/ui/nll/match-guards-always-borrow.ast.nll.stderr
blob: 4d647949038ace4baf275a96b820c3190146e441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
warning[E0507]: cannot move out of borrowed content
  --> $DIR/match-guards-always-borrow.rs:13:13
   |
LL |             (|| { let bar = foo; bar.take() })();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
   |
   = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
   = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future

error: compilation successful
  --> $DIR/match-guards-always-borrow.rs:47:1
   |
LL | / fn main() { //[ast]~ ERROR compilation successful
LL | |     should_reject_destructive_mutate_in_guard();
LL | |     allow_mutate_in_arm_body();
LL | |     allow_move_into_arm_body();
LL | | }
   | |_^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0507`.