From bec090253534b651388e90ec39a7b996fdf48600 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 7 Oct 2019 10:59:13 -0400 Subject: [PATCH] avoid ICE when extracting closure-kind-ty from a canonicalized value In such a case, the `Infer` is converted to a `Bound` --- src/librustc/ty/sty.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 3f09bf749edc..10935863d531 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -2199,7 +2199,9 @@ impl<'tcx> TyS<'tcx> { _ => bug!("cannot convert type `{:?}` to a closure kind", self), }, - Infer(_) => None, + // "Bound" types appear in canonical queries when the + // closure type is not yet known + Bound(..) | Infer(_) => None, Error => Some(ty::ClosureKind::Fn),