1
Fork 0

Migrate borrow of moved value diagnostic

This commit is contained in:
TheOddGarlic 2022-08-30 20:01:28 +03:00 committed by mejrs
parent eeef05b318
commit 3a9a06311d
3 changed files with 29 additions and 17 deletions

View file

@ -287,3 +287,9 @@ mir_build_irrefutable_let_patterns_while_let = irrefutable `while let` {$count -
*[other] these patterns
} will always match, so the loop will never exit
.help = consider instead using a `loop {"{"} ... {"}"}` with a `let` inside it
mir_build_borrow_of_moved_value = borrow of moved value
.label = value moved into `{$name}` here
.occurs_because_label = move occurs because `{$name}` has type `{$ty}` which does not implement the `Copy` trait
.value_borrowed_label = value borrowed here after move
.suggest_borrowing = borrow this binding in the pattern to avoid moving the value