30 lines
1.2 KiB
Plaintext
30 lines
1.2 KiB
Plaintext
warning: lifetime flowing from input to output with different syntax can be confusing
|
|
--> $DIR/self_lifetime-async.rs:6:29
|
|
|
|
|
LL | async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
|
|
| ^^ --- the lifetime gets resolved as `'b`
|
|
| |
|
|
| this lifetime flows to the output
|
|
|
|
|
= note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
|
|
help: one option is to consistently use `'b`
|
|
|
|
|
LL | async fn foo<'b>(self: &'b Foo<'a>) -> &'b () { self.0 }
|
|
| ++
|
|
|
|
warning: lifetime flowing from input to output with different syntax can be confusing
|
|
--> $DIR/self_lifetime-async.rs:12:42
|
|
|
|
|
LL | async fn bar<'a>(self: &Alias, arg: &'a ()) -> &() { arg }
|
|
| ^^ --- the lifetime gets resolved as `'a`
|
|
| |
|
|
| this lifetime flows to the output
|
|
|
|
|
help: one option is to consistently use `'a`
|
|
|
|
|
LL | async fn bar<'a>(self: &Alias, arg: &'a ()) -> &'a () { arg }
|
|
| ++
|
|
|
|
warning: 2 warnings emitted
|
|
|