diff options
| author | trevyn <230691+trevyn@users.noreply.github.com> | 2024-01-20 02:30:58 +0400 |
|---|---|---|
| committer | trevyn <230691+trevyn@users.noreply.github.com> | 2024-01-20 02:30:58 +0400 |
| commit | de2575f35d46dfa2b24eb205ef133a679bff1b31 (patch) | |
| tree | a092ec25542ef7d4f0a2b5bd2f9591fc2553d065 /compiler/rustc_resolve/src | |
| parent | 0943a6b188e11339d217d43f39322f51d2d8187d (diff) | |
| download | rust-de2575f35d46dfa2b24eb205ef133a679bff1b31.tar.gz rust-de2575f35d46dfa2b24eb205ef133a679bff1b31.zip | |
Don't delete any lifetimes with bounds
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 5a95f2083f6..abb0a7a465a 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -2567,8 +2567,9 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> { debug!(?param.ident, ?param.ident.span, ?use_span); 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( lint::builtin::SINGLE_USE_LIFETIMES, param.id, |
