Skip to content

Commit 22c65f9

Browse files
committed
Do not ICE on closure typeck
Tackle #66868.
1 parent 1e2a738 commit 22c65f9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/librustc/traits/error_reporting.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2214,6 +2214,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
22142214
}
22152215

22162216
let span = self.tcx.def_span(generator_did);
2217+
// Do not ICE on closure typeck (#66868).
2218+
if let None = self.tcx.hir().as_local_hir_id(generator_did) {
2219+
return false;
2220+
}
22172221
let tables = self.tcx.typeck_tables_of(generator_did);
22182222
debug!("note_obligation_cause_for_async_await: generator_did={:?} span={:?} ",
22192223
generator_did, span);

0 commit comments

Comments
 (0)