1
Fork 0

clear in-scope lifetimes for nested items in HIR lowering

This was causing us to incorrectly think the lifetimes were
already declared on the scope for the nested item, when in fact
they are not inherited.
This commit is contained in:
Niko Matsakis 2019-08-12 21:08:32 -04:00
parent a02a171e6a
commit e4756e6b07
3 changed files with 65 additions and 4 deletions

View file

@ -0,0 +1,17 @@
// Test that async fn works when nested inside of
// impls with lifetime parameters.
//
// check-pass
// edition:2018
#![feature(async_await)]
struct Foo<'a>(&'a ());
impl<'a> Foo<'a> {
fn test() {
async fn test() {}
}
}
fn main() { }