diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2019-08-12 21:08:32 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2019-08-12 21:08:32 -0400 |
| commit | e4756e6b07989d1cf195667bcf5d9f780618031a (patch) | |
| tree | c9d93df466b0bf5c9fc7873fd49461d0d164bec4 /src/test/ui/async-await/nested-in-impl.rs | |
| parent | a02a171e6a8e1cf601867230bba577c0351461b2 (diff) | |
| download | rust-e4756e6b07989d1cf195667bcf5d9f780618031a.tar.gz rust-e4756e6b07989d1cf195667bcf5d9f780618031a.zip | |
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.
Diffstat (limited to 'src/test/ui/async-await/nested-in-impl.rs')
| -rw-r--r-- | src/test/ui/async-await/nested-in-impl.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/async-await/nested-in-impl.rs b/src/test/ui/async-await/nested-in-impl.rs new file mode 100644 index 00000000000..3c82160595f --- /dev/null +++ b/src/test/ui/async-await/nested-in-impl.rs @@ -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() { } |
