2023-02-21 15:11:08 -06:00
|
|
|
error[E0521]: borrowed data escapes outside of method
|
2022-10-27 11:15:11 -05:00
|
|
|
--> $DIR/issue-72312.rs:12:9
|
2021-10-12 08:16:36 -05:00
|
|
|
|
|
|
|
|
LL | pub async fn start(&self) {
|
2021-10-12 08:28:02 -05:00
|
|
|
| -----
|
|
|
|
| |
|
2023-02-21 15:11:08 -06:00
|
|
|
| `self` is a reference that is only valid in the method body
|
2021-10-12 08:28:02 -05:00
|
|
|
| let's call the lifetime of this reference `'1`
|
2021-10-12 08:16:36 -05:00
|
|
|
...
|
2022-10-27 11:15:11 -05:00
|
|
|
LL | / require_static(async move {
|
2022-05-21 14:46:25 -05:00
|
|
|
LL | |
|
|
|
|
LL | |
|
|
|
|
LL | |
|
2021-10-12 08:16:36 -05:00
|
|
|
LL | | &self;
|
|
|
|
LL | | });
|
2022-10-27 11:15:11 -05:00
|
|
|
| | ^
|
|
|
|
| | |
|
2023-02-21 15:11:08 -06:00
|
|
|
| |__________`self` escapes the method body here
|
2022-10-27 11:15:11 -05:00
|
|
|
| argument requires that `'1` must outlive `'static`
|
2021-10-12 08:16:36 -05:00
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2021-10-12 08:16:36 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0521`.
|