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