]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #89734 - estebank:issue-72312, r=nikomatsakis
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 11 Dec 2021 16:35:23 +0000 (17:35 +0100)
committerGitHub <noreply@github.com>
Sat, 11 Dec 2021 16:35:23 +0000 (17:35 +0100)
commit7bba5c163c3530d3eeab03128bd1c72d331a16df
treed034c2d3ce35992fd3c49b376340f3ad1390046c
parent433a13b47347849dbc8c5d5300b98b95be7fb2c9
parentd2d9eb3715e61d16eafb55b4b8cb03fdc6bfc871
Rollup merge of #89734 - estebank:issue-72312, r=nikomatsakis

Point at capture points for non-`'static` reference crossing a `yield` point

```
error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
  --> $DIR/issue-72312.rs:10:24
   |
LL |     pub async fn start(&self) {
   |                        ^^^^^ this data with an anonymous lifetime `'_`...
...
LL |         require_static(async move {
   |         -------------- ...is required to live as long as `'static` here...
LL |             &self;
   |             ----- ...and is captured here
   |
note: `'static` lifetime requirement introduced by this trait bound
  --> $DIR/issue-72312.rs:2:22
   |
LL | fn require_static<T: 'static>(val: T) -> T {
   |                      ^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0759`.
```

Fix #72312.