Skip to content
Permalink
Browse files

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

In such a case, the `Infer` is converted to a `Bound`
  • Loading branch information...
nikomatsakis committed Oct 7, 2019
1 parent 0b58d9d commit bec090253534b651388e90ec39a7b996fdf48600
Showing with 3 additions and 1 deletion.
  1. +3 −1 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),

0 comments on commit bec0902

Please sign in to comment.
You can’t perform that action at this time.