about summary refs log tree commit diff
path: root/src/test/ui/issues
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-11 17:35:23 +0100
committerGitHub <noreply@github.com>2021-12-11 17:35:23 +0100
commit7bba5c163c3530d3eeab03128bd1c72d331a16df (patch)
treed034c2d3ce35992fd3c49b376340f3ad1390046c /src/test/ui/issues
parent433a13b47347849dbc8c5d5300b98b95be7fb2c9 (diff)
parentd2d9eb3715e61d16eafb55b4b8cb03fdc6bfc871 (diff)
downloadrust-7bba5c163c3530d3eeab03128bd1c72d331a16df.tar.gz
rust-7bba5c163c3530d3eeab03128bd1c72d331a16df.zip
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.
Diffstat (limited to 'src/test/ui/issues')
-rw-r--r--src/test/ui/issues/issue-16922.stderr2
-rw-r--r--src/test/ui/issues/issue-46983.stderr2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/issues/issue-16922.stderr b/src/test/ui/issues/issue-16922.stderr
index 8b09b7d5907..53405a660f8 100644
--- a/src/test/ui/issues/issue-16922.stderr
+++ b/src/test/ui/issues/issue-16922.stderr
@@ -4,7 +4,7 @@ error[E0759]: `value` has an anonymous lifetime `'_` but it needs to satisfy a `
 LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
    |                       -- this data with an anonymous lifetime `'_`...
 LL |     Box::new(value) as Box<dyn Any>
-   |              ^^^^^ ...is captured here, requiring it to live as long as `'static`
+   |              ^^^^^ ...is used and required to live as long as `'static` here
    |
 help: to declare that the trait object captures data from argument `value`, you can add an explicit `'_` lifetime bound
    |
diff --git a/src/test/ui/issues/issue-46983.stderr b/src/test/ui/issues/issue-46983.stderr
index 77fb130f519..ed9f1884c42 100644
--- a/src/test/ui/issues/issue-46983.stderr
+++ b/src/test/ui/issues/issue-46983.stderr
@@ -4,7 +4,7 @@ error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'sta
 LL | fn foo(x: &u32) -> &'static u32 {
    |           ---- this data with an anonymous lifetime `'_`...
 LL |     &*x
-   |     ^^^ ...is captured and required to live as long as `'static` here
+   |     ^^^ ...is used and required to live as long as `'static` here
 
 error: aborting due to previous error