Skip to content

Commit 6594c75

Browse files
Move ConstEvaluatable to Clause
1 parent 52d3fc9 commit 6594c75

File tree

30 files changed

+54
-55
lines changed

30 files changed

+54
-55
lines changed

compiler/rustc_hir_analysis/src/astconv/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,14 +1529,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
15291529
}
15301530
ty::Clause::RegionOutlives(_)
15311531
| ty::Clause::ConstArgHasType(..)
1532-
| ty::Clause::WellFormed(_) => bug!(),
1532+
| ty::Clause::WellFormed(_)
1533+
| ty::Clause::ConstEvaluatable(_) => bug!(),
15331534
},
15341535
ty::PredicateKind::AliasRelate(..)
15351536
| ty::PredicateKind::ObjectSafe(_)
15361537
| ty::PredicateKind::ClosureKind(_, _, _)
15371538
| ty::PredicateKind::Subtype(_)
15381539
| ty::PredicateKind::Coerce(_)
1539-
| ty::PredicateKind::ConstEvaluatable(_)
15401540
| ty::PredicateKind::ConstEquate(_, _)
15411541
| ty::PredicateKind::TypeWellFormedFromEnv(_)
15421542
| ty::PredicateKind::Ambiguous => bug!(),

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,9 +1032,9 @@ fn check_type_defn<'tcx>(tcx: TyCtxt<'tcx>, item: &hir::Item<'tcx>, all_sized: b
10321032
tcx,
10331033
cause,
10341034
wfcx.param_env,
1035-
ty::Binder::dummy(ty::PredicateKind::ConstEvaluatable(
1035+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(
10361036
ty::Const::from_anon_const(tcx, discr_def_id.expect_local()),
1037-
)),
1037+
))),
10381038
));
10391039
}
10401040
}

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 7 additions & 9 deletions
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
impl<'tcx> Binder<'tcx, Clause<'tcx>> {
@@ -638,9 +641,6 @@ pub enum PredicateKind<'tcx> {
638641
/// logic.
639642
Coerce(CoercePredicate<'tcx>),
640643

641-
/// Constant initializer must evaluate successfully.
642-
ConstEvaluatable(ty::Const<'tcx>),
643-
644644
/// Constants must be equal. The first component is the const that is expected.
645645
ConstEquate(Const<'tcx>, Const<'tcx>),
646646

@@ -1328,7 +1328,7 @@ impl<'tcx> Predicate<'tcx> {
13281328
| PredicateKind::ObjectSafe(..)
13291329
| PredicateKind::ClosureKind(..)
13301330
| PredicateKind::Clause(Clause::TypeOutlives(..))
1331-
| PredicateKind::ConstEvaluatable(..)
1331+
| PredicateKind::Clause(Clause::ConstEvaluatable(..))
13321332
| PredicateKind::ConstEquate(..)
13331333
| PredicateKind::Ambiguous
13341334
| PredicateKind::TypeWellFormedFromEnv(..) => None,
@@ -1349,7 +1349,7 @@ impl<'tcx> Predicate<'tcx> {
13491349
| PredicateKind::ObjectSafe(..)
13501350
| PredicateKind::ClosureKind(..)
13511351
| PredicateKind::Clause(Clause::TypeOutlives(..))
1352-
| PredicateKind::ConstEvaluatable(..)
1352+
| PredicateKind::Clause(Clause::ConstEvaluatable(..))
13531353
| PredicateKind::ConstEquate(..)
13541354
| PredicateKind::Ambiguous
13551355
| PredicateKind::TypeWellFormedFromEnv(..) => None,
@@ -1370,7 +1370,7 @@ impl<'tcx> Predicate<'tcx> {
13701370
| PredicateKind::Clause(Clause::WellFormed(..))
13711371
| PredicateKind::ObjectSafe(..)
13721372
| PredicateKind::ClosureKind(..)
1373-
| PredicateKind::ConstEvaluatable(..)
1373+
| PredicateKind::Clause(Clause::ConstEvaluatable(..))
13741374
| PredicateKind::ConstEquate(..)
13751375
| PredicateKind::Ambiguous
13761376
| PredicateKind::TypeWellFormedFromEnv(..) => None,
@@ -1384,10 +1384,8 @@ impl<'tcx> Predicate<'tcx> {
13841384
PredicateKind::AliasRelate(..)
13851385
| PredicateKind::Subtype(..)
13861386
| PredicateKind::Coerce(..)
1387-
| PredicateKind::WellFormed(..)
13881387
| PredicateKind::ObjectSafe(..)
13891388
| PredicateKind::ClosureKind(..)
1390-
| PredicateKind::ConstEvaluatable(..)
13911389
| PredicateKind::ConstEquate(..)
13921390
| PredicateKind::Ambiguous
13931391
| PredicateKind::TypeWellFormedFromEnv(..) => None,

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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`.
@@ -2487,7 +2487,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
24872487
}
24882488
}
24892489

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

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

compiler/rustc_trait_selection/src/traits/fulfill.rs

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 6 deletions
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(),
@@ -977,7 +979,7 @@ pub(crate) fn required_region_bounds<'tcx>(
977979
| ty::PredicateKind::ObjectSafe(..)
978980
| ty::PredicateKind::ClosureKind(..)
979981
| ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..))
980-
| ty::PredicateKind::ConstEvaluatable(..)
982+
| ty::PredicateKind::Clause(ty::Clause::ConstEvaluatable(..))
981983
| ty::PredicateKind::ConstEquate(..)
982984
| ty::PredicateKind::Ambiguous
983985
| ty::PredicateKind::AliasRelate(..)

0 commit comments

Comments
 (0)