Skip to content

Commit 446e03e

Browse files
committed
rustc_borrowck: make suggestion to move closure translatable
1 parent 48413cf commit 446e03e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/rustc_borrowck/messages.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ borrowck_higher_ranked_subtype_error =
8080
borrowck_lifetime_constraints_error =
8181
lifetime may not live long enough
8282
83+
borrowck_move_closure_suggestion =
84+
consider adding 'move' keyword before the nested closure
85+
8386
borrowck_move_out_place_here =
8487
{$place} is moved here
8588

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
11731173
}
11741174

11751175
#[allow(rustc::diagnostic_outside_of_impl)]
1176-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
11771176
fn suggest_move_on_borrowing_closure(&self, diag: &mut Diag<'_>) {
11781177
let map = self.infcx.tcx.hir();
11791178
let body = map.body_owned_by(self.mir_def_id());
@@ -1212,7 +1211,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
12121211
if let Some(closure_span) = closure_span {
12131212
diag.span_suggestion_verbose(
12141213
closure_span,
1215-
"consider adding 'move' keyword before the nested closure",
1214+
fluent_generated::borrowck_move_closure_suggestion,
12161215
"move ",
12171216
Applicability::MaybeIncorrect,
12181217
);

0 commit comments

Comments
 (0)