Collect late-bound regions from all closure parents in closure_mapping

This commit is contained in:
Michael Goulet 2022-10-31 03:28:05 +00:00
parent 630dff6ba7
commit f27bdf1750
4 changed files with 91 additions and 40 deletions

View file

@ -0,0 +1,9 @@
// check-pass
#![feature(closure_lifetime_binder)]
#![feature(rustc_attrs)]
#[rustc_regions]
fn main() {
for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
}

View file

@ -0,0 +1,38 @@
note: external requirements
--> $DIR/nested-closures-regions.rs:8:24
|
LL | for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: main::{closure#0}::{closure#0} with closure substs [
i8,
extern "rust-call" fn((&(),)),
(),
]
= note: late-bound region is '_#4r
= note: late-bound region is '_#2r
= note: number of external vids: 3
= note: where '_#1r: '_#2r
= note: where '_#2r: '_#1r
note: no external requirements
--> $DIR/nested-closures-regions.rs:8:5
|
LL | for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
| ^^^^^^^^^^^^^^^^
|
= note: defining type: main::{closure#0} with closure substs [
i8,
extern "rust-call" fn(()),
(),
]
= note: late-bound region is '_#2r
note: no external requirements
--> $DIR/nested-closures-regions.rs:7:1
|
LL | fn main() {
| ^^^^^^^^^
|
= note: defining type: main