avoid ICE when extracting closure-kind-ty from a canonicalized value

In such a case, the `Infer` is converted to a `Bound`
This commit is contained in:
Niko Matsakis 2019-10-07 10:59:13 -04:00
parent 0b58d9d124
commit bec0902535

View file

@ -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),