about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-06 23:27:00 +0100
committerGitHub <noreply@github.com>2019-12-06 23:27:00 +0100
commit459398dc40deb76ff2aab5ac9d2f00ce68bf6d3d (patch)
tree0b3dbd811ebcace87304d757b7b9ca3a21a6851f /src
parent941c4cd56bee9bc9f16eba7a7ab6c2b332da0f9f (diff)
parent22c65f924266ba738fa3621ea07d31bc7ba8c45f (diff)
downloadrust-459398dc40deb76ff2aab5ac9d2f00ce68bf6d3d.tar.gz
rust-459398dc40deb76ff2aab5ac9d2f00ce68bf6d3d.zip
Rollup merge of #67071 - estebank:issue-66868, r=davidtwco
Do not ICE on closure typeck

Tackle #66868.

r? @davidtwco
Diffstat (limited to 'src')
-rw-r--r--src/librustc/traits/error_reporting.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs
index 412300f0b10..35017d6330d 100644
--- a/src/librustc/traits/error_reporting.rs
+++ b/src/librustc/traits/error_reporting.rs
@@ -2210,6 +2210,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);