mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-31 09:04:18 +00:00
Don't delete any lifetimes with bounds
This commit is contained in:
parent
0943a6b188
commit
de2575f35d
@ -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,
|
||||
|
@ -11,11 +11,6 @@ note: the lint level is defined here
|
||||
|
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user