mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Detect when a lifetime is being reused in suggestion
This commit is contained in:
@@ -35,7 +35,7 @@ LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
|
||||
| | let's call the lifetime of this reference `'1`
|
||||
| lifetime `'a` defined here
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
help: consider reusing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | async fn bar<'a>(self: Alias<&'a Self>, arg: &'a ()) -> &() { arg }
|
||||
| ++
|
||||
|
||||
@@ -38,7 +38,7 @@ LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() {
|
||||
LL | arg
|
||||
| ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
|
||||
|
|
||||
help: consider introducing a named lifetime parameter and update trait if needed
|
||||
help: consider reusing a named lifetime parameter and update trait if needed
|
||||
|
|
||||
LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &'a () {
|
||||
| ++
|
||||
|
||||
Reference in New Issue
Block a user