2025-07-10 18:36:22 -04:00
|
|
|
warning: eliding a lifetime that's named elsewhere is confusing
|
2025-08-23 20:54:02 +00:00
|
|
|
--> $DIR/self_lifetime-async.rs:6:44
|
2024-08-31 15:31:31 +03:00
|
|
|
|
|
|
|
|
|
LL | async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
|
2025-08-23 20:54:02 +00:00
|
|
|
| -- ^^^ the same lifetime is elided here
|
2025-03-17 12:43:55 -04:00
|
|
|
| |
|
2025-07-10 18:36:22 -04:00
|
|
|
| the lifetime is named here
|
2024-08-31 15:31:31 +03:00
|
|
|
|
|
2025-07-10 18:36:22 -04:00
|
|
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
|
2025-03-17 12:43:55 -04:00
|
|
|
= note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
|
2025-07-10 18:36:22 -04:00
|
|
|
help: consistently use `'b`
|
2025-03-17 12:43:55 -04:00
|
|
|
|
|
|
|
|
|
LL | async fn foo<'b>(self: &'b Foo<'a>) -> &'b () { self.0 }
|
|
|
|
|
| ++
|
2024-08-31 15:31:31 +03:00
|
|
|
|
2025-07-10 18:36:22 -04:00
|
|
|
warning: eliding a lifetime that's named elsewhere is confusing
|
2025-08-23 20:54:02 +00:00
|
|
|
--> $DIR/self_lifetime-async.rs:12:52
|
2024-08-31 15:31:31 +03:00
|
|
|
|
|
|
|
|
|
LL | async fn bar<'a>(self: &Alias, arg: &'a ()) -> &() { arg }
|
2025-08-23 20:54:02 +00:00
|
|
|
| -- ^^^ the same lifetime is elided here
|
2025-03-17 12:43:55 -04:00
|
|
|
| |
|
2025-07-10 18:36:22 -04:00
|
|
|
| the lifetime is named here
|
2025-03-17 12:43:55 -04:00
|
|
|
|
|
2025-07-10 18:36:22 -04:00
|
|
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
|
|
|
|
|
help: consistently use `'a`
|
2025-03-17 12:43:55 -04:00
|
|
|
|
|
|
|
|
|
LL | async fn bar<'a>(self: &Alias, arg: &'a ()) -> &'a () { arg }
|
|
|
|
|
| ++
|
2024-08-31 15:31:31 +03:00
|
|
|
|
|
|
|
|
warning: 2 warnings emitted
|
|
|
|
|
|