Skip to content

Commit 4252464

Browse files
Dont filter
1 parent 68fc0b9 commit 4252464

File tree

2 files changed

+13
-22
lines changed
  • compiler
    • rustc_infer/src/infer
    • rustc_next_trait_solver/src/solve/eval_ctxt

2 files changed

+13
-22
lines changed

compiler/rustc_infer/src/infer/context.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -545,17 +545,6 @@ where
545545
HasChanged::Yes => None,
546546
HasChanged::No => {
547547
let mut stalled_vars = orig_values;
548-
549-
// Remove the canonicalized universal vars, since we only care about stalled existentials.
550-
stalled_vars.retain(|arg| match arg.kind() {
551-
ty::GenericArgKind::Type(ty) => matches!(ty.kind(), ty::Infer(_)),
552-
ty::GenericArgKind::Const(ct) => {
553-
matches!(ct.kind(), ty::ConstKind::Infer(_))
554-
}
555-
// Lifetimes can never stall goals.
556-
ty::GenericArgKind::Lifetime(_) => false,
557-
});
558-
559548
// Remove the unconstrained RHS arg, which is expected to have changed.
560549
if let Some(normalizes_to) = goal.predicate.as_normalizes_to() {
561550
let normalizes_to = normalizes_to.skip_binder();

0 commit comments

Comments
 (0)