only allow ConstEquate
with feature(gce)
This commit is contained in:
parent
1536a53ea4
commit
292f0c599f
@ -495,19 +495,20 @@ fn process_obligation(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ty::PredicateKind::ConstEquate(c1, c2) => {
|
ty::PredicateKind::ConstEquate(c1, c2) => {
|
||||||
|
assert!(
|
||||||
|
self.selcx.tcx().features().generic_const_exprs,
|
||||||
|
"`ConstEquate` without a feature gate: {c1:?} {c2:?}",
|
||||||
|
);
|
||||||
debug!(?c1, ?c2, "equating consts");
|
debug!(?c1, ?c2, "equating consts");
|
||||||
let tcx = self.selcx.tcx();
|
// FIXME: we probably should only try to unify abstract constants
|
||||||
if tcx.features().generic_const_exprs {
|
// if the constants depend on generic parameters.
|
||||||
// FIXME: we probably should only try to unify abstract constants
|
//
|
||||||
// if the constants depend on generic parameters.
|
// Let's just see where this breaks :shrug:
|
||||||
//
|
if let (ty::ConstKind::Unevaluated(a), ty::ConstKind::Unevaluated(b)) =
|
||||||
// Let's just see where this breaks :shrug:
|
(c1.kind(), c2.kind())
|
||||||
if let (ty::ConstKind::Unevaluated(a), ty::ConstKind::Unevaluated(b)) =
|
{
|
||||||
(c1.kind(), c2.kind())
|
if infcx.try_unify_abstract_consts(a, b, obligation.param_env) {
|
||||||
{
|
return ProcessResult::Changed(vec![]);
|
||||||
if infcx.try_unify_abstract_consts(a, b, obligation.param_env) {
|
|
||||||
return ProcessResult::Changed(vec![]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -677,19 +677,21 @@ fn evaluate_predicate_recursively<'o>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ty::PredicateKind::ConstEquate(c1, c2) => {
|
ty::PredicateKind::ConstEquate(c1, c2) => {
|
||||||
|
assert!(
|
||||||
|
self.tcx().features().generic_const_exprs,
|
||||||
|
"`ConstEquate` without a feature gate: {c1:?} {c2:?}",
|
||||||
|
);
|
||||||
debug!(?c1, ?c2, "evaluate_predicate_recursively: equating consts");
|
debug!(?c1, ?c2, "evaluate_predicate_recursively: equating consts");
|
||||||
|
|
||||||
if self.tcx().features().generic_const_exprs {
|
// FIXME: we probably should only try to unify abstract constants
|
||||||
// FIXME: we probably should only try to unify abstract constants
|
// if the constants depend on generic parameters.
|
||||||
// if the constants depend on generic parameters.
|
//
|
||||||
//
|
// Let's just see where this breaks :shrug:
|
||||||
// Let's just see where this breaks :shrug:
|
if let (ty::ConstKind::Unevaluated(a), ty::ConstKind::Unevaluated(b)) =
|
||||||
if let (ty::ConstKind::Unevaluated(a), ty::ConstKind::Unevaluated(b)) =
|
(c1.kind(), c2.kind())
|
||||||
(c1.kind(), c2.kind())
|
{
|
||||||
{
|
if self.infcx.try_unify_abstract_consts(a, b, obligation.param_env) {
|
||||||
if self.infcx.try_unify_abstract_consts(a, b, obligation.param_env) {
|
return Ok(EvaluatedToOk);
|
||||||
return Ok(EvaluatedToOk);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user