Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix async fn lowering ICE with APIT. #60527

Merged
merged 1 commit into from May 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/librustc/hir/map/def_collector.rs
Expand Up @@ -92,10 +92,12 @@ impl<'a> DefCollector<'a> {
visit::walk_generics(this, generics);

// Walk the generated arguments for the `async fn`.
for a in arguments {
for (i, a) in arguments.iter().enumerate() {
use visit::Visitor;
if let Some(arg) = &a.arg {
this.visit_ty(&arg.ty);
} else {
this.visit_ty(&decl.inputs[i].ty);
}
}

Expand Down
12 changes: 12 additions & 0 deletions src/test/ui/async-await/issue-60518.rs
@@ -0,0 +1,12 @@
// compile-pass
// edition:2018

#![feature(async_await)]

// This is a regression test to ensure that simple bindings (where replacement arguments aren't
// created during async fn lowering) that have their DefId used during HIR lowering (such as impl
// trait) are visited during def collection and thus have a DefId.

async fn foo(ws: impl Iterator<Item = ()>) {}

fn main() {}