1
Fork 0

Do not ICE on closure typeck

Tackle #66868.
This commit is contained in:
Esteban Küber 2019-12-05 09:21:52 -08:00
parent 1e2a73867d
commit 22c65f9242

View file

@ -2214,6 +2214,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}
let span = self.tcx.def_span(generator_did);
// Do not ICE on closure typeck (#66868).
if let None = self.tcx.hir().as_local_hir_id(generator_did) {
return false;
}
let tables = self.tcx.typeck_tables_of(generator_did);
debug!("note_obligation_cause_for_async_await: generator_did={:?} span={:?} ",
generator_did, span);