-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that associated
async fn
s have unique fresh param names
- Loading branch information
1 parent
2e72448
commit 1471f0b
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// check-pass | ||
// Check that the anonymous lifetimes used here aren't considered to shadow one | ||
// another. Note that `async fn` is different to `fn` here because the lifetimes | ||
// are numbered by HIR lowering, rather than lifetime resolution. | ||
|
||
// edition:2018 | ||
|
||
struct A<'a, 'b>(&'a &'b i32); | ||
struct B<'a>(&'a i32); | ||
|
||
impl A<'_, '_> { | ||
async fn assoc(x: &u32, y: B<'_>) { | ||
async fn nested(x: &u32, y: A<'_, '_>) {} | ||
} | ||
|
||
async fn assoc2(x: &u32, y: A<'_, '_>) { | ||
impl A<'_, '_> { | ||
async fn nested_assoc(x: &u32, y: B<'_>) {} | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |