forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#65142 - matthewjasper:unshadow-anon-lifetim…
…es, r=petrochenkov Ensure that associated `async fn`s have unique fresh param names Closes rust-lang#64630
- Loading branch information
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() {} |