Don't delete any lifetimes with bounds

This commit is contained in:
trevyn 2024-01-20 02:30:58 +04:00
parent 0943a6b188
commit de2575f35d
2 changed files with 2 additions and 6 deletions

View File

@ -2567,8 +2567,9 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
debug!(?param.ident, ?param.ident.span, ?use_span); debug!(?param.ident, ?param.ident.span, ?use_span);
let elidable = matches!(use_ctxt, LifetimeCtxt::Ref); let elidable = matches!(use_ctxt, LifetimeCtxt::Ref);
let deletion_span =
if param.bounds.is_empty() { deletion_span() } else { None };
let deletion_span = deletion_span();
self.r.lint_buffer.buffer_lint_with_diagnostic( self.r.lint_buffer.buffer_lint_with_diagnostic(
lint::builtin::SINGLE_USE_LIFETIMES, lint::builtin::SINGLE_USE_LIFETIMES,
param.id, param.id,

View File

@ -11,11 +11,6 @@ note: the lint level is defined here
| |
LL | #![deny(single_use_lifetimes)] LL | #![deny(single_use_lifetimes)]
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
LL - pub fn get<'b: 'a>(&'b self) -> &'a str {
LL + pub fn get(&self) -> &'a str {
|
error: aborting due to 1 previous error error: aborting due to 1 previous error