Detect when a lifetime is being reused in suggestion

This commit is contained in:
Esteban Küber
2024-05-17 21:23:47 +00:00
parent 1775e7b93d
commit cf5702ee91
10 changed files with 13 additions and 9 deletions
@@ -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 () {
| ++