about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
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 /compiler/rustc_borrowck/src
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 'compiler/rustc_borrowck/src')
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs b/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs
index 1bc9f8cf3cc..881ebed6029 100644
--- a/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs
@@ -368,6 +368,7 @@ fn try_extract_error_from_fulfill_cx<'tcx>(
                 error_region,
                 cause.clone(),
                 placeholder_region,
+                vec![],
             ),
         ),
         (Some(error_region), _) => NiceRegionError::new(