Skip to content

Commit bec0902

Browse files
committed
avoid ICE when extracting closure-kind-ty from a canonicalized value
In such a case, the `Infer` is converted to a `Bound`
1 parent 0b58d9d commit bec0902

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc/ty/sty.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,9 @@ impl<'tcx> TyS<'tcx> {
21992199
_ => bug!("cannot convert type `{:?}` to a closure kind", self),
22002200
},
22012201

2202-
Infer(_) => None,
2202+
// "Bound" types appear in canonical queries when the
2203+
// closure type is not yet known
2204+
Bound(..) | Infer(_) => None,
22032205

22042206
Error => Some(ty::ClosureKind::Fn),
22052207

0 commit comments

Comments
 (0)