1
Fork 0

run borrowck tests on BIDs and emit tail-expr-drop-order lints for

potential violations
This commit is contained in:
Ding Xiang Fei 2024-12-05 02:58:59 +08:00 committed by Michael Goulet
parent 6afee111c2
commit 045271cccc
6 changed files with 155 additions and 17 deletions

View file

@ -213,6 +213,9 @@ borrowck_suggest_create_fresh_reborrow =
borrowck_suggest_iterate_over_slice =
consider iterating over a slice of the `{$ty}`'s content to avoid moving into the `for` loop
borrowck_tail_expr_drop_order = a temporary value will be dropped here before the execution exits the block in Edition 2024, which will raise borrow checking error
.label = consider using a `let` binding to create a longer lived value; or replacing the `{"{"} .. {"}"}` block with curly brackets `( .. )`; or folding the rest of the expression into the surrounding `unsafe {"{"} .. {"}"}`
borrowck_ty_no_impl_copy =
{$is_partial_move ->
[true] partial move