rustc_borrowck: make suggestion to move closure translatable
This commit is contained in:
@@ -80,6 +80,9 @@ borrowck_higher_ranked_subtype_error =
|
|||||||
borrowck_lifetime_constraints_error =
|
borrowck_lifetime_constraints_error =
|
||||||
lifetime may not live long enough
|
lifetime may not live long enough
|
||||||
|
|
||||||
|
borrowck_move_closure_suggestion =
|
||||||
|
consider adding 'move' keyword before the nested closure
|
||||||
|
|
||||||
borrowck_move_out_place_here =
|
borrowck_move_out_place_here =
|
||||||
{$place} is moved here
|
{$place} is moved here
|
||||||
|
|
||||||
|
|||||||
@@ -1173,7 +1173,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||||
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
|
|
||||||
fn suggest_move_on_borrowing_closure(&self, diag: &mut Diag<'_>) {
|
fn suggest_move_on_borrowing_closure(&self, diag: &mut Diag<'_>) {
|
||||||
let map = self.infcx.tcx.hir();
|
let map = self.infcx.tcx.hir();
|
||||||
let body = map.body_owned_by(self.mir_def_id());
|
let body = map.body_owned_by(self.mir_def_id());
|
||||||
@@ -1212,7 +1211,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
|
|||||||
if let Some(closure_span) = closure_span {
|
if let Some(closure_span) = closure_span {
|
||||||
diag.span_suggestion_verbose(
|
diag.span_suggestion_verbose(
|
||||||
closure_span,
|
closure_span,
|
||||||
"consider adding 'move' keyword before the nested closure",
|
fluent_generated::borrowck_move_closure_suggestion,
|
||||||
"move ",
|
"move ",
|
||||||
Applicability::MaybeIncorrect,
|
Applicability::MaybeIncorrect,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user