@@ -24,7 +24,7 @@ pub fn obligations<'a, 'tcx>(
24
24
) -> Option < Vec < traits:: PredicateObligation < ' tcx > > > {
25
25
// Handle the "livelock" case (see comment above) by bailing out if necessary.
26
26
let ty = match ty. kind {
27
- ty:: Infer ( _ ) => {
27
+ ty:: Infer ( ty :: TyVar ( _ ) ) => {
28
28
let resolved_ty = infcx. shallow_resolve ( ty) ;
29
29
if resolved_ty == ty {
30
30
// No progress, bail out to prevent "livelock".
@@ -356,6 +356,12 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
356
356
// WfScalar, WfParameter, etc
357
357
}
358
358
359
+ // Can only infer to `ty::Int(_) | ty::Uint(_)`.
360
+ ty:: Infer ( ty:: IntVar ( _) ) => { }
361
+
362
+ // Can only infer to `ty::Float(_)`.
363
+ ty:: Infer ( ty:: FloatVar ( _) ) => { }
364
+
359
365
ty:: Slice ( subty) => {
360
366
self . require_sized ( subty, traits:: SliceOrArrayElem ) ;
361
367
}
@@ -514,7 +520,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
514
520
// prevention, which happens before this can be reached.
515
521
ty:: Infer ( _) => {
516
522
let ty = self . infcx . shallow_resolve ( ty) ;
517
- if let ty:: Infer ( _ ) = ty. kind {
523
+ if let ty:: Infer ( ty :: TyVar ( _ ) ) = ty. kind {
518
524
// Not yet resolved, but we've made progress.
519
525
let cause = self . cause ( traits:: MiscObligation ) ;
520
526
self . out . push ( traits:: Obligation :: new (
0 commit comments