mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
rustc_borrowck: make "implicit static" suff translatable
This commit is contained in:
parent
1b6cc24c20
commit
1481ab3f75
@ -77,6 +77,15 @@ borrowck_higher_ranked_lifetime_error =
|
|||||||
borrowck_higher_ranked_subtype_error =
|
borrowck_higher_ranked_subtype_error =
|
||||||
higher-ranked subtype error
|
higher-ranked subtype error
|
||||||
|
|
||||||
|
borrowck_implicit_static =
|
||||||
|
this has an implicit `'static` lifetime requirement
|
||||||
|
|
||||||
|
borrowck_implicit_static_introduced =
|
||||||
|
calling this method introduces the `impl`'s `'static` requirement
|
||||||
|
|
||||||
|
borrowck_implicit_static_relax =
|
||||||
|
consider relaxing the implicit `'static` requirement
|
||||||
|
|
||||||
borrowck_lifetime_constraints_error =
|
borrowck_lifetime_constraints_error =
|
||||||
lifetime may not live long enough
|
lifetime may not live long enough
|
||||||
|
|
||||||
|
@ -975,7 +975,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
|
|
||||||
#[instrument(skip(self, err), level = "debug")]
|
#[instrument(skip(self, err), level = "debug")]
|
||||||
fn suggest_constrain_dyn_trait_in_impl(
|
fn suggest_constrain_dyn_trait_in_impl(
|
||||||
&self,
|
&self,
|
||||||
@ -994,15 +993,15 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
|
|||||||
for span in &traits {
|
for span in &traits {
|
||||||
let mut multi_span: MultiSpan = vec![*span].into();
|
let mut multi_span: MultiSpan = vec![*span].into();
|
||||||
multi_span
|
multi_span
|
||||||
.push_span_label(*span, "this has an implicit `'static` lifetime requirement");
|
.push_span_label(*span, fluent_generated::borrowck_implicit_static);
|
||||||
multi_span.push_span_label(
|
multi_span.push_span_label(
|
||||||
ident.span,
|
ident.span,
|
||||||
"calling this method introduces the `impl`'s `'static` requirement",
|
fluent_generated::borrowck_implicit_static_introduced,
|
||||||
);
|
);
|
||||||
err.subdiagnostic(RequireStaticErr::UsedImpl { multi_span });
|
err.subdiagnostic(RequireStaticErr::UsedImpl { multi_span });
|
||||||
err.span_suggestion_verbose(
|
err.span_suggestion_verbose(
|
||||||
span.shrink_to_hi(),
|
span.shrink_to_hi(),
|
||||||
"consider relaxing the implicit `'static` requirement",
|
fluent_generated::borrowck_implicit_static_relax,
|
||||||
" + '_",
|
" + '_",
|
||||||
Applicability::MaybeIncorrect,
|
Applicability::MaybeIncorrect,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user