]> git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/async-assoc-fn-anon-lifetimes.rs
New upstream version 1.39.0+dfsg1
[rustc.git] / src / test / ui / async-await / async-assoc-fn-anon-lifetimes.rs
1 // check-pass
2 // Check that the anonymous lifetimes used here aren't considered to shadow one
3 // another. Note that `async fn` is different to `fn` here because the lifetimes
4 // are numbered by HIR lowering, rather than lifetime resolution.
5
6 // edition:2018
7
8 struct A<'a, 'b>(&'a &'b i32);
9 struct B<'a>(&'a i32);
10
11 impl A<'_, '_> {
12 async fn assoc(x: &u32, y: B<'_>) {
13 async fn nested(x: &u32, y: A<'_, '_>) {}
14 }
15
16 async fn assoc2(x: &u32, y: A<'_, '_>) {
17 impl A<'_, '_> {
18 async fn nested_assoc(x: &u32, y: B<'_>) {}
19 }
20 }
21 }
22
23 fn main() {}