Auto merge of #124417 - Xiretza:translate-early-lints, r=fmease
Make early lints translatable
<del>Requires https://github.com/projectfluent/fluent-rs/pull/353.</del> 5134a04eaa
r? diagnostics
This commit is contained in:
commit
791adf759c
80 changed files with 2114 additions and 907 deletions
|
@ -2652,15 +2652,15 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
|
|||
let deletion_span =
|
||||
if param.bounds.is_empty() { deletion_span() } else { None };
|
||||
|
||||
self.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.r.lint_buffer.buffer_lint(
|
||||
lint::builtin::SINGLE_USE_LIFETIMES,
|
||||
param.id,
|
||||
param.ident.span,
|
||||
format!("lifetime parameter `{}` only used once", param.ident),
|
||||
lint::BuiltinLintDiag::SingleUseLifetime {
|
||||
param_span: param.ident.span,
|
||||
use_span: Some((use_span, elidable)),
|
||||
deletion_span,
|
||||
ident: param.ident,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -2670,15 +2670,15 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
|
|||
|
||||
// if the lifetime originates from expanded code, we won't be able to remove it #104432
|
||||
if deletion_span.is_some_and(|sp| !sp.in_derive_expansion()) {
|
||||
self.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.r.lint_buffer.buffer_lint(
|
||||
lint::builtin::UNUSED_LIFETIMES,
|
||||
param.id,
|
||||
param.ident.span,
|
||||
format!("lifetime parameter `{}` never used", param.ident),
|
||||
lint::BuiltinLintDiag::SingleUseLifetime {
|
||||
param_span: param.ident.span,
|
||||
use_span: None,
|
||||
deletion_span,
|
||||
ident: param.ident,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue