Skip to content

Commit 903e6db

Browse files
Move ConstEvaluatable to Clause
1 parent c6e7685 commit 903e6db

File tree

30 files changed

+54
-53
lines changed

30 files changed

+54
-53
lines changed

compiler/rustc_hir_analysis/src/astconv/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1518,14 +1518,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
15181518
}
15191519
ty::Clause::RegionOutlives(_)
15201520
| ty::Clause::ConstArgHasType(..)
1521-
| ty::Clause::WellFormed(_) => bug!(),
1521+
| ty::Clause::WellFormed(_)
1522+
| ty::Clause::ConstEvaluatable(_) => bug!(),
15221523
},
15231524
ty::PredicateKind::AliasRelate(..)
15241525
| ty::PredicateKind::ObjectSafe(_)
15251526
| ty::PredicateKind::ClosureKind(_, _, _)
15261527
| ty::PredicateKind::Subtype(_)
15271528
| ty::PredicateKind::Coerce(_)
1528-
| ty::PredicateKind::ConstEvaluatable(_)
15291529
| ty::PredicateKind::ConstEquate(_, _)
15301530
| ty::PredicateKind::TypeWellFormedFromEnv(_)
15311531
| ty::PredicateKind::Ambiguous => bug!(),

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1024,9 +1024,9 @@ fn check_type_defn<'tcx>(tcx: TyCtxt<'tcx>, item: &hir::Item<'tcx>, all_sized: b
10241024
tcx,
10251025
cause,
10261026
wfcx.param_env,
1027-
ty::Binder::dummy(ty::PredicateKind::ConstEvaluatable(
1027+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(
10281028
ty::Const::from_anon_const(tcx, discr_def_id.expect_local()),
1029-
)),
1029+
))),
10301030
));
10311031
}
10321032
}

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ fn const_evaluatable_predicates_of(
353353
if let ty::ConstKind::Unevaluated(_) = ct.kind() {
354354
let span = self.tcx.def_span(c.def_id);
355355
self.preds.insert((
356-
ty::Binder::dummy(ty::PredicateKind::ConstEvaluatable(ct))
356+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(ct)))
357357
.to_predicate(self.tcx),
358358
span,
359359
));

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ fn trait_predicate_kind<'tcx>(
547547
| ty::PredicateKind::Coerce(_)
548548
| ty::PredicateKind::ObjectSafe(_)
549549
| ty::PredicateKind::ClosureKind(..)
550-
| ty::PredicateKind::ConstEvaluatable(..)
550+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
551551
| ty::PredicateKind::ConstEquate(..)
552552
| ty::PredicateKind::Ambiguous
553553
| ty::PredicateKind::TypeWellFormedFromEnv(..) => None,

compiler/rustc_hir_analysis/src/outlives/explicit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> {
6161
| ty::PredicateKind::ClosureKind(..)
6262
| ty::PredicateKind::Subtype(..)
6363
| ty::PredicateKind::Coerce(..)
64-
| ty::PredicateKind::ConstEvaluatable(..)
64+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
6565
| ty::PredicateKind::ConstEquate(..)
6666
| ty::PredicateKind::Ambiguous
6767
| ty::PredicateKind::TypeWellFormedFromEnv(..) => (),

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
671671
| ty::PredicateKind::Clause(ty::Clause::WellFormed(..))
672672
| ty::PredicateKind::ObjectSafe(..)
673673
| ty::PredicateKind::AliasRelate(..)
674-
| ty::PredicateKind::ConstEvaluatable(..)
674+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
675675
| ty::PredicateKind::ConstEquate(..)
676676
// N.B., this predicate is created by breaking down a
677677
// `ClosureType: FnFoo()` predicate, where

compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3232
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(arg, ty)) => {
3333
vec![ty.into(), arg.into()]
3434
}
35-
ty::PredicateKind::ConstEvaluatable(e) => vec![e.into()],
35+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(e)) => vec![e.into()],
3636
_ => return false,
3737
};
3838

compiler/rustc_hir_typeck/src/method/probe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
842842
| ty::PredicateKind::ObjectSafe(..)
843843
| ty::PredicateKind::ClosureKind(..)
844844
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))
845-
| ty::PredicateKind::ConstEvaluatable(..)
845+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
846846
| ty::PredicateKind::ConstEquate(..)
847847
| ty::PredicateKind::Ambiguous
848848
| ty::PredicateKind::AliasRelate(..)

compiler/rustc_infer/src/infer/outlives/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn explicit_outlives_bounds<'tcx>(
3333
| ty::PredicateKind::ObjectSafe(..)
3434
| ty::PredicateKind::ClosureKind(..)
3535
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))
36-
| ty::PredicateKind::ConstEvaluatable(..)
36+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
3737
| ty::PredicateKind::ConstEquate(..)
3838
| ty::PredicateKind::Ambiguous
3939
| ty::PredicateKind::TypeWellFormedFromEnv(..) => None,

compiler/rustc_infer/src/traits/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl<'tcx, O: Elaboratable<'tcx>> Elaborator<'tcx, O> {
249249
ty::PredicateKind::ClosureKind(..) => {
250250
// Nothing to elaborate when waiting for a closure's kind to be inferred.
251251
}
252-
ty::PredicateKind::ConstEvaluatable(..) => {
252+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..)) => {
253253
// Currently, we do not elaborate const-evaluatable
254254
// predicates.
255255
}

compiler/rustc_lint/src/builtin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1611,12 +1611,12 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
16111611
AliasRelate(..) |
16121612
// Ignore bounds that a user can't type
16131613
Clause(Clause::WellFormed(..)) |
1614+
// FIXME(generic_const_exprs): `ConstEvaluatable` can be written
1615+
Clause(Clause::ConstEvaluatable(..)) |
16141616
ObjectSafe(..) |
16151617
ClosureKind(..) |
16161618
Subtype(..) |
16171619
Coerce(..) |
1618-
// FIXME(generic_const_exprs): `ConstEvaluatable` can be written
1619-
ConstEvaluatable(..) |
16201620
ConstEquate(..) |
16211621
Ambiguous |
16221622
TypeWellFormedFromEnv(..) => continue,

compiler/rustc_middle/src/ty/flags.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl FlagComputation {
277277
ty::PredicateKind::ClosureKind(_def_id, substs, _kind) => {
278278
self.add_substs(substs);
279279
}
280-
ty::PredicateKind::ConstEvaluatable(uv) => {
280+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(uv)) => {
281281
self.add_const(uv);
282282
}
283283
ty::PredicateKind::ConstEquate(expected, found) => {

compiler/rustc_middle/src/ty/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl<'tcx> Predicate<'tcx> {
547547
| PredicateKind::ClosureKind(_, _, _)
548548
| PredicateKind::Subtype(_)
549549
| PredicateKind::Coerce(_)
550-
| PredicateKind::ConstEvaluatable(_)
550+
| PredicateKind::Clause(Clause::ConstEvaluatable(_))
551551
| PredicateKind::ConstEquate(_, _)
552552
| PredicateKind::Ambiguous
553553
| PredicateKind::TypeWellFormedFromEnv(_) => true,
@@ -587,6 +587,9 @@ pub enum Clause<'tcx> {
587587

588588
/// No syntax: `T` well-formed.
589589
WellFormed(GenericArg<'tcx>),
590+
591+
/// Constant initializer must evaluate successfully.
592+
ConstEvaluatable(ty::Const<'tcx>),
590593
}
591594

592595
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable)]
@@ -620,9 +623,6 @@ pub enum PredicateKind<'tcx> {
620623
/// logic.
621624
Coerce(CoercePredicate<'tcx>),
622625

623-
/// Constant initializer must evaluate successfully.
624-
ConstEvaluatable(ty::Const<'tcx>),
625-
626626
/// Constants must be equal. The first component is the const that is expected.
627627
ConstEquate(Const<'tcx>, Const<'tcx>),
628628

@@ -1279,7 +1279,7 @@ impl<'tcx> Predicate<'tcx> {
12791279
| PredicateKind::ObjectSafe(..)
12801280
| PredicateKind::ClosureKind(..)
12811281
| PredicateKind::Clause(Clause::TypeOutlives(..))
1282-
| PredicateKind::ConstEvaluatable(..)
1282+
| PredicateKind::Clause(Clause::ConstEvaluatable(..))
12831283
| PredicateKind::ConstEquate(..)
12841284
| PredicateKind::Ambiguous
12851285
| PredicateKind::TypeWellFormedFromEnv(..) => None,
@@ -1300,7 +1300,7 @@ impl<'tcx> Predicate<'tcx> {
13001300
| PredicateKind::ObjectSafe(..)
13011301
| PredicateKind::ClosureKind(..)
13021302
| PredicateKind::Clause(Clause::TypeOutlives(..))
1303-
| PredicateKind::ConstEvaluatable(..)
1303+
| PredicateKind::Clause(Clause::ConstEvaluatable(..))
13041304
| PredicateKind::ConstEquate(..)
13051305
| PredicateKind::Ambiguous
13061306
| PredicateKind::TypeWellFormedFromEnv(..) => None,
@@ -1321,7 +1321,7 @@ impl<'tcx> Predicate<'tcx> {
13211321
| PredicateKind::Clause(Clause::WellFormed(..))
13221322
| PredicateKind::ObjectSafe(..)
13231323
| PredicateKind::ClosureKind(..)
1324-
| PredicateKind::ConstEvaluatable(..)
1324+
| PredicateKind::Clause(Clause::ConstEvaluatable(..))
13251325
| PredicateKind::ConstEquate(..)
13261326
| PredicateKind::Ambiguous
13271327
| PredicateKind::TypeWellFormedFromEnv(..) => None,

compiler/rustc_middle/src/ty/print/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,7 @@ define_print_and_forward_display! {
28862886
print_value_path(closure_def_id, &[]),
28872887
write("` implements the trait `{}`", kind)
28882888
),
2889-
ty::PredicateKind::ConstEvaluatable(ct) => {
2889+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(ct)) => {
28902890
p!("the constant `", print(ct), "` can be evaluated")
28912891
}
28922892
ty::PredicateKind::ConstEquate(c1, c2) => {

compiler/rustc_middle/src/ty/structural_impls.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ impl<'tcx> fmt::Debug for ty::Clause<'tcx> {
180180
ty::Clause::TypeOutlives(ref pair) => pair.fmt(f),
181181
ty::Clause::Projection(ref pair) => pair.fmt(f),
182182
ty::Clause::WellFormed(ref data) => write!(f, "WellFormed({:?})", data),
183+
ty::Clause::ConstEvaluatable(ct) => {
184+
write!(f, "ConstEvaluatable({ct:?})")
185+
}
183186
}
184187
}
185188
}
@@ -196,9 +199,6 @@ impl<'tcx> fmt::Debug for ty::PredicateKind<'tcx> {
196199
ty::PredicateKind::ClosureKind(closure_def_id, closure_substs, kind) => {
197200
write!(f, "ClosureKind({:?}, {:?}, {:?})", closure_def_id, closure_substs, kind)
198201
}
199-
ty::PredicateKind::ConstEvaluatable(ct) => {
200-
write!(f, "ConstEvaluatable({ct:?})")
201-
}
202202
ty::PredicateKind::ConstEquate(c1, c2) => write!(f, "ConstEquate({:?}, {:?})", c1, c2),
203203
ty::PredicateKind::TypeWellFormedFromEnv(ty) => {
204204
write!(f, "TypeWellFormedFromEnv({:?})", ty)

compiler/rustc_privacy/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ where
182182
ct.visit_with(self)?;
183183
ty.visit_with(self)
184184
}
185-
ty::PredicateKind::ConstEvaluatable(ct) => ct.visit_with(self),
185+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(ct)) => ct.visit_with(self),
186186
ty::PredicateKind::Clause(ty::Clause::WellFormed(arg)) => arg.visit_with(self),
187187

188188
ty::PredicateKind::ObjectSafe(_)

compiler/rustc_trait_selection/src/solve/eval_ctxt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
326326
self.evaluate_added_goals_and_make_canonical_response(Certainty::AMBIGUOUS)
327327
}
328328
// FIXME: implement this predicate :)
329-
ty::PredicateKind::ConstEvaluatable(_) => {
329+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(_)) => {
330330
self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
331331
}
332332
ty::PredicateKind::ConstEquate(_, _) => {

compiler/rustc_trait_selection/src/solve/fulfill.rs

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
121121
ty::PredicateKind::Clause(_)
122122
| ty::PredicateKind::ObjectSafe(_)
123123
| ty::PredicateKind::ClosureKind(_, _, _)
124-
| ty::PredicateKind::ConstEvaluatable(_)
125124
| ty::PredicateKind::Ambiguous => {
126125
FulfillmentErrorCode::CodeSelectionError(
127126
SelectionError::Unimplemented,

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
833833
| ty::PredicateKind::ClosureKind(..)
834834
| ty::PredicateKind::Subtype(..)
835835
// FIXME(generic_const_exprs): you can absolutely add this as a where clauses
836-
| ty::PredicateKind::ConstEvaluatable(..)
836+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
837837
| ty::PredicateKind::Coerce(..) => {}
838838
ty::PredicateKind::TypeWellFormedFromEnv(..) => {
839839
bug!("predicate should only exist in the environment: {bound_predicate:?}")

compiler/rustc_trait_selection/src/traits/const_evaluatable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn satisfied_from_param_env<'tcx>(
207207

208208
for pred in param_env.caller_bounds() {
209209
match pred.kind().skip_binder() {
210-
ty::PredicateKind::ConstEvaluatable(ce) => {
210+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(ce)) => {
211211
let b_ct = tcx.expand_abstract_consts(ce);
212212
let mut v = Visitor { ct, infcx, param_env, single_match };
213213
let _ = b_ct.visit_with(&mut v);

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
10691069
}
10701070
}
10711071

1072-
ty::PredicateKind::ConstEvaluatable(..) => {
1072+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..)) => {
10731073
// Errors for `ConstEvaluatable` predicates show up as
10741074
// `SelectionError::ConstEvalFailure`,
10751075
// not `Unimplemented`.
@@ -2486,7 +2486,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
24862486
}
24872487
}
24882488

2489-
ty::PredicateKind::ConstEvaluatable(data) => {
2489+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(data)) => {
24902490
if predicate.references_error() || self.tainted_by_errors().is_some() {
24912491
return;
24922492
}
@@ -3324,7 +3324,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
33243324
}
33253325

33263326
match obligation.predicate.kind().skip_binder() {
3327-
ty::PredicateKind::ConstEvaluatable(ct) => {
3327+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(ct)) => {
33283328
let ty::ConstKind::Unevaluated(uv) = ct.kind() else {
33293329
bug!("const evaluatable failed for non-unevaluated const `{ct:?}`");
33303330
};

compiler/rustc_trait_selection/src/traits/fulfill.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
359359
| ty::PredicateKind::ClosureKind(..)
360360
| ty::PredicateKind::Subtype(_)
361361
| ty::PredicateKind::Coerce(_)
362-
| ty::PredicateKind::ConstEvaluatable(..)
362+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
363363
| ty::PredicateKind::ConstEquate(..) => {
364364
let pred =
365365
ty::Binder::dummy(infcx.instantiate_binder_with_placeholders(binder));
@@ -498,7 +498,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
498498
}
499499
}
500500

501-
ty::PredicateKind::ConstEvaluatable(uv) => {
501+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(uv)) => {
502502
match const_evaluatable::is_const_evaluatable(
503503
self.selcx.infcx,
504504
uv,

compiler/rustc_trait_selection/src/traits/object_safety.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ fn predicate_references_self<'tcx>(
318318
| ty::PredicateKind::Subtype(..)
319319
| ty::PredicateKind::Coerce(..)
320320
// FIXME(generic_const_exprs): this can mention `Self`
321-
| ty::PredicateKind::ConstEvaluatable(..)
321+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
322322
| ty::PredicateKind::ConstEquate(..)
323323
| ty::PredicateKind::Ambiguous
324324
| ty::PredicateKind::TypeWellFormedFromEnv(..) => None,
@@ -365,7 +365,7 @@ fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
365365
| ty::PredicateKind::ObjectSafe(..)
366366
| ty::PredicateKind::ClosureKind(..)
367367
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))
368-
| ty::PredicateKind::ConstEvaluatable(..)
368+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
369369
| ty::PredicateKind::ConstEquate(..)
370370
| ty::PredicateKind::AliasRelate(..)
371371
| ty::PredicateKind::Ambiguous

compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub fn compute_implied_outlives_bounds_inner<'tcx>(
130130
| ty::PredicateKind::Clause(ty::Clause::Projection(..))
131131
| ty::PredicateKind::ClosureKind(..)
132132
| ty::PredicateKind::ObjectSafe(..)
133-
| ty::PredicateKind::ConstEvaluatable(..)
133+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
134134
| ty::PredicateKind::ConstEquate(..)
135135
| ty::PredicateKind::Ambiguous
136136
| ty::PredicateKind::AliasRelate(..)

compiler/rustc_trait_selection/src/traits/select/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
862862
}
863863
}
864864

865-
ty::PredicateKind::ConstEvaluatable(uv) => {
865+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(uv)) => {
866866
match const_evaluatable::is_const_evaluatable(
867867
self.infcx,
868868
uv,

compiler/rustc_trait_selection/src/traits/wf.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub fn predicate_obligations<'tcx>(
164164
wf.compute(arg);
165165
}
166166

167-
ty::PredicateKind::ConstEvaluatable(ct) => {
167+
ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(ct)) => {
168168
wf.compute(ct.into());
169169
}
170170

@@ -521,8 +521,9 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
521521
let obligations = self.nominal_obligations(uv.def, uv.substs);
522522
self.out.extend(obligations);
523523

524-
let predicate =
525-
ty::Binder::dummy(ty::PredicateKind::ConstEvaluatable(ct));
524+
let predicate = ty::Binder::dummy(ty::PredicateKind::Clause(
525+
ty::Clause::ConstEvaluatable(ct),
526+
));
526527
let cause = self.cause(traits::WellFormed(None));
527528
self.out.push(traits::Obligation::with_depth(
528529
self.tcx(),
@@ -554,8 +555,9 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
554555
// the future we may allow directly lowering to `ConstKind::Expr` in which case
555556
// we would not be proving bounds we should.
556557

557-
let predicate =
558-
ty::Binder::dummy(ty::PredicateKind::ConstEvaluatable(ct));
558+
let predicate = ty::Binder::dummy(ty::PredicateKind::Clause(
559+
ty::Clause::ConstEvaluatable(ct),
560+
));
559561
let cause = self.cause(traits::WellFormed(None));
560562
self.out.push(traits::Obligation::with_depth(
561563
self.tcx(),
@@ -972,7 +974,7 @@ pub(crate) fn required_region_bounds<'tcx>(
972974
| ty::PredicateKind::ObjectSafe(..)
973975
| ty::PredicateKind::ClosureKind(..)
974976
| ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..))
975-
| ty::PredicateKind::ConstEvaluatable(..)
977+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
976978
| ty::PredicateKind::ConstEquate(..)
977979
| ty::PredicateKind::Ambiguous
978980
| ty::PredicateKind::AliasRelate(..)

0 commit comments

Comments
 (0)