Skip to content

Commit 8912015

Browse files
No const equate in new solver
1 parent 2c1473c commit 8912015

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

compiler/rustc_trait_selection/src/solve/eval_ctxt.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,13 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
322322
ty::PredicateKind::Ambiguous => {
323323
self.evaluate_added_goals_and_make_canonical_response(Certainty::AMBIGUOUS)
324324
}
325-
// FIXME: implement these predicates :)
326-
ty::PredicateKind::ConstEvaluatable(_) | ty::PredicateKind::ConstEquate(_, _) => {
325+
// FIXME: implement this predicate :)
326+
ty::PredicateKind::ConstEvaluatable(_) => {
327327
self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
328328
}
329+
ty::PredicateKind::ConstEquate(_, _) => {
330+
bug!("ConstEquate should not be emitted when `-Ztrait-solver=next` is active")
331+
}
329332
ty::PredicateKind::TypeWellFormedFromEnv(..) => {
330333
bug!("TypeWellFormedFromEnv is only used for Chalk")
331334
}

compiler/rustc_trait_selection/src/solve/fulfill.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,6 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
118118
TypeError::Sorts(expected_found),
119119
)
120120
}
121-
ty::PredicateKind::ConstEquate(a, b) => {
122-
let (a, b) = infcx.instantiate_binder_with_placeholders(
123-
goal.predicate.kind().rebind((a, b)),
124-
);
125-
let expected_found = ExpectedFound::new(true, a, b);
126-
FulfillmentErrorCode::CodeConstEquateError(
127-
expected_found,
128-
TypeError::ConstMismatch(expected_found),
129-
)
130-
}
131121
ty::PredicateKind::Clause(_)
132122
| ty::PredicateKind::WellFormed(_)
133123
| ty::PredicateKind::ObjectSafe(_)
@@ -138,7 +128,8 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
138128
SelectionError::Unimplemented,
139129
)
140130
}
141-
ty::PredicateKind::TypeWellFormedFromEnv(_) => {
131+
ty::PredicateKind::ConstEquate(..)
132+
| ty::PredicateKind::TypeWellFormedFromEnv(_) => {
142133
bug!("unexpected goal: {goal:?}")
143134
}
144135
},

0 commit comments

Comments
 (0)