@@ -96,8 +96,8 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
9696 false
9797 }
9898 ty:: GenericArgKind :: Type ( ty) => {
99- if let ty :: Infer ( infer_ty ) = * ty. kind ( ) {
100- match infer_ty {
99+ match * ty. kind ( ) {
100+ ty :: Infer ( infer_ty ) => match infer_ty {
101101 ty:: InferTy :: TyVar ( vid) => {
102102 !self . probe_ty_var ( vid) . is_err_and ( |_| self . root_var ( vid) == vid)
103103 }
@@ -119,22 +119,24 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
119119 }
120120 ty:: InferTy :: FreshTy ( _)
121121 | ty:: InferTy :: FreshIntTy ( _)
122- | ty:: InferTy :: FreshFloatTy ( _) => true ,
123- }
124- } else {
125- true
122+ | ty:: InferTy :: FreshFloatTy ( _) => unreachable ! ( ) ,
123+ } ,
124+ // This was a canonicalized universal var, so it doesn't change.
125+ ty:: Param ( _) | ty:: Placeholder ( _) => false ,
126+ _ => unreachable ! ( "unexpected orig value: {arg}" ) ,
126127 }
127128 }
128129 ty:: GenericArgKind :: Const ( ct) => {
129- if let ty :: ConstKind :: Infer ( infer_ct ) = ct. kind ( ) {
130- match infer_ct {
130+ match ct. kind ( ) {
131+ ty :: ConstKind :: Infer ( infer_ct ) => match infer_ct {
131132 ty:: InferConst :: Var ( vid) => !self
132133 . probe_const_var ( vid)
133134 . is_err_and ( |_| self . root_const_var ( vid) == vid) ,
134135 ty:: InferConst :: Fresh ( _) => true ,
135- }
136- } else {
137- true
136+ } ,
137+ // This was a canonicalized universal var, so it doesn't change.
138+ ty:: ConstKind :: Param ( _) | ty:: ConstKind :: Placeholder ( _) => false ,
139+ _ => unreachable ! ( "unexpected orig value: {arg}" ) ,
138140 }
139141 }
140142 }
0 commit comments