Skip to content

Commit c6e7685

Browse files
Move WF goal to clause
1 parent 2304917 commit c6e7685

File tree

37 files changed

+81
-64
lines changed

37 files changed

+81
-64
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ fn check_opaque_type_well_formed<'tcx>(
330330
// Require the hidden type to be well-formed with only the generics of the opaque type.
331331
// Defining use functions may have more bounds than the opaque type, which is ok, as long as the
332332
// hidden type is well formed even without those bounds.
333-
let predicate = ty::Binder::dummy(ty::PredicateKind::WellFormed(definition_ty.into()));
333+
let predicate =
334+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::WellFormed(definition_ty.into())));
334335
ocx.register_obligation(Obligation::misc(tcx, definition_span, def_id, param_env, predicate));
335336

336337
// Check that all obligations are satisfied by the implementation's

compiler/rustc_borrowck/src/type_check/mod.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1419,9 +1419,11 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14191419
//
14201420
// See #91068 for an example.
14211421
self.prove_predicates(
1422-
sig.inputs_and_output
1423-
.iter()
1424-
.map(|ty| ty::Binder::dummy(ty::PredicateKind::WellFormed(ty.into()))),
1422+
sig.inputs_and_output.iter().map(|ty| {
1423+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::WellFormed(
1424+
ty.into(),
1425+
)))
1426+
}),
14251427
term_location.to_locations(),
14261428
ConstraintCategory::Boring,
14271429
);
@@ -1850,7 +1852,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
18501852

18511853
let array_ty = rvalue.ty(body.local_decls(), tcx);
18521854
self.prove_predicate(
1853-
ty::PredicateKind::WellFormed(array_ty.into()),
1855+
ty::PredicateKind::Clause(ty::Clause::WellFormed(array_ty.into())),
18541856
Locations::Single(location),
18551857
ConstraintCategory::Boring,
18561858
);

compiler/rustc_hir_analysis/src/astconv/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1516,10 +1516,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
15161516
ty::Clause::TypeOutlives(_) => {
15171517
// Do nothing, we deal with regions separately
15181518
}
1519-
ty::Clause::RegionOutlives(_) | ty::Clause::ConstArgHasType(..) => bug!(),
1519+
ty::Clause::RegionOutlives(_)
1520+
| ty::Clause::ConstArgHasType(..)
1521+
| ty::Clause::WellFormed(_) => bug!(),
15201522
},
1521-
ty::PredicateKind::WellFormed(_)
1522-
| ty::PredicateKind::AliasRelate(..)
1523+
ty::PredicateKind::AliasRelate(..)
15231524
| ty::PredicateKind::ObjectSafe(_)
15241525
| ty::PredicateKind::ClosureKind(_, _, _)
15251526
| ty::PredicateKind::Subtype(_)

compiler/rustc_hir_analysis/src/check/check.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ fn check_opaque_meets_bounds<'tcx>(
439439
// Additionally require the hidden type to be well-formed with only the generics of the opaque type.
440440
// Defining use functions may have more bounds than the opaque type, which is ok, as long as the
441441
// hidden type is well formed even without those bounds.
442-
let predicate = ty::Binder::dummy(ty::PredicateKind::WellFormed(hidden_ty.into()));
442+
let predicate =
443+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::WellFormed(hidden_ty.into())));
443444
ocx.register_obligation(Obligation::new(tcx, misc_cause, param_env, predicate));
444445

445446
// Check that all obligations are satisfied by the implementation's

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ fn compare_method_predicate_entailment<'tcx>(
321321
infcx.tcx,
322322
ObligationCause::dummy(),
323323
param_env,
324-
ty::Binder::dummy(ty::PredicateKind::WellFormed(unnormalized_impl_fty.into())),
324+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::WellFormed(
325+
unnormalized_impl_fty.into(),
326+
))),
325327
));
326328
}
327329

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
8181
self.tcx(),
8282
cause,
8383
param_env,
84-
ty::Binder::dummy(ty::PredicateKind::WellFormed(arg)),
84+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::WellFormed(arg))),
8585
));
8686
}
8787
}
@@ -1856,7 +1856,8 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
18561856
// We lower empty bounds like `Vec<dyn Copy>:` as
18571857
// `WellFormed(Vec<dyn Copy>)`, which will later get checked by
18581858
// regular WF checking
1859-
if let ty::PredicateKind::WellFormed(..) = pred.kind().skip_binder() {
1859+
if let ty::PredicateKind::Clause(ty::Clause::WellFormed(..)) = pred.kind().skip_binder()
1860+
{
18601861
continue;
18611862
}
18621863
// Match the existing behavior.

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
219219
} else {
220220
let span = bound_pred.bounded_ty.span;
221221
let predicate = ty::Binder::bind_with_vars(
222-
ty::PredicateKind::WellFormed(ty.into()),
222+
ty::PredicateKind::Clause(ty::Clause::WellFormed(ty.into())),
223223
bound_vars,
224224
);
225225
predicates.insert((predicate.to_predicate(tcx), span));

compiler/rustc_hir_analysis/src/hir_wf_check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn diagnostic_hir_wf_check<'tcx>(
7979
self.tcx,
8080
cause,
8181
self.param_env,
82-
ty::PredicateKind::WellFormed(tcx_ty.into()),
82+
ty::PredicateKind::Clause(ty::Clause::WellFormed(tcx_ty.into())),
8383
));
8484

8585
for error in ocx.select_all_or_error() {

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ fn trait_predicate_kind<'tcx>(
542542
| ty::PredicateKind::Clause(ty::Clause::Projection(_))
543543
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
544544
| ty::PredicateKind::AliasRelate(..)
545-
| ty::PredicateKind::WellFormed(_)
545+
| ty::PredicateKind::Clause(ty::Clause::WellFormed(_))
546546
| ty::PredicateKind::Subtype(_)
547547
| ty::PredicateKind::Coerce(_)
548548
| ty::PredicateKind::ObjectSafe(_)

compiler/rustc_hir_analysis/src/outlives/explicit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> {
5555
ty::PredicateKind::Clause(ty::Clause::Trait(..))
5656
| ty::PredicateKind::Clause(ty::Clause::Projection(..))
5757
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
58-
| ty::PredicateKind::WellFormed(..)
58+
| ty::PredicateKind::Clause(ty::Clause::WellFormed(..))
5959
| ty::PredicateKind::AliasRelate(..)
6060
| ty::PredicateKind::ObjectSafe(..)
6161
| ty::PredicateKind::ClosureKind(..)

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
483483
self.tcx,
484484
cause,
485485
self.param_env,
486-
ty::Binder::dummy(ty::PredicateKind::WellFormed(arg)),
486+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::WellFormed(arg))),
487487
));
488488
}
489489

@@ -668,7 +668,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
668668
| ty::PredicateKind::Coerce(..)
669669
| ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..))
670670
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))
671-
| ty::PredicateKind::WellFormed(..)
671+
| ty::PredicateKind::Clause(ty::Clause::WellFormed(..))
672672
| ty::PredicateKind::ObjectSafe(..)
673673
| ty::PredicateKind::AliasRelate(..)
674674
| ty::PredicateKind::ConstEvaluatable(..)

compiler/rustc_hir_typeck/src/method/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
452452
tcx,
453453
obligation.cause,
454454
self.param_env,
455-
ty::Binder::dummy(ty::PredicateKind::WellFormed(method_ty.into())),
455+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::WellFormed(method_ty.into()))),
456456
));
457457

458458
let callee = MethodCallee { def_id, substs, sig: fn_sig };

compiler/rustc_hir_typeck/src/method/probe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
838838
| ty::PredicateKind::Coerce(..)
839839
| ty::PredicateKind::Clause(ty::Clause::Projection(..))
840840
| ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..))
841-
| ty::PredicateKind::WellFormed(..)
841+
| ty::PredicateKind::Clause(ty::Clause::WellFormed(..))
842842
| ty::PredicateKind::ObjectSafe(..)
843843
| ty::PredicateKind::ClosureKind(..)
844844
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))

compiler/rustc_hir_typeck/src/method/suggest.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
696696
};
697697

698698
// Don't point out the span of `WellFormed` predicates.
699-
if !matches!(p.kind().skip_binder(), ty::PredicateKind::Clause(_)) {
699+
if !matches!(
700+
p.kind().skip_binder(),
701+
ty::PredicateKind::Clause(ty::Clause::Projection(..) | ty::Clause::Trait(..))
702+
) {
700703
continue;
701704
};
702705

compiler/rustc_infer/src/infer/combine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
417417
self.tcx(),
418418
self.trace.cause.clone(),
419419
self.param_env,
420-
ty::Binder::dummy(ty::PredicateKind::WellFormed(b_ty.into())),
420+
ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::WellFormed(b_ty.into()))),
421421
));
422422
}
423423

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn explicit_outlives_bounds<'tcx>(
2929
| ty::PredicateKind::AliasRelate(..)
3030
| ty::PredicateKind::Coerce(..)
3131
| ty::PredicateKind::Subtype(..)
32-
| ty::PredicateKind::WellFormed(..)
32+
| ty::PredicateKind::Clause(ty::Clause::WellFormed(..))
3333
| ty::PredicateKind::ObjectSafe(..)
3434
| ty::PredicateKind::ClosureKind(..)
3535
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))

compiler/rustc_infer/src/traits/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl<'tcx, O: Elaboratable<'tcx>> Elaborator<'tcx, O> {
227227
debug!(?data, ?obligations, "super_predicates");
228228
self.extend_deduped(obligations);
229229
}
230-
ty::PredicateKind::WellFormed(..) => {
230+
ty::PredicateKind::Clause(ty::Clause::WellFormed(..)) => {
231231
// Currently, we do not elaborate WF predicates,
232232
// although we easily could.
233233
}

compiler/rustc_lint/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
16101610
Clause(Clause::Projection(..)) |
16111611
AliasRelate(..) |
16121612
// Ignore bounds that a user can't type
1613-
WellFormed(..) |
1613+
Clause(Clause::WellFormed(..)) |
16141614
ObjectSafe(..) |
16151615
ClosureKind(..) |
16161616
Subtype(..) |

compiler/rustc_middle/src/ty/flags.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl FlagComputation {
270270
self.add_alias_ty(projection_ty);
271271
self.add_term(term);
272272
}
273-
ty::PredicateKind::WellFormed(arg) => {
273+
ty::PredicateKind::Clause(ty::Clause::WellFormed(arg)) => {
274274
self.add_substs(slice::from_ref(&arg));
275275
}
276276
ty::PredicateKind::ObjectSafe(_def_id) => {}

compiler/rustc_middle/src/ty/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl<'tcx> Predicate<'tcx> {
523523
ty::PredicateKind::Clause(ty::Clause::Trait(data)) => {
524524
tcx.trait_is_coinductive(data.def_id())
525525
}
526-
ty::PredicateKind::WellFormed(_) => true,
526+
ty::PredicateKind::Clause(ty::Clause::WellFormed(_)) => true,
527527
_ => false,
528528
}
529529
}
@@ -536,7 +536,7 @@ impl<'tcx> Predicate<'tcx> {
536536
#[inline]
537537
pub fn allow_normalization(self) -> bool {
538538
match self.kind().skip_binder() {
539-
PredicateKind::WellFormed(_) => false,
539+
PredicateKind::Clause(Clause::WellFormed(_)) => false,
540540
PredicateKind::Clause(Clause::Trait(_))
541541
| PredicateKind::Clause(Clause::RegionOutlives(_))
542542
| PredicateKind::Clause(Clause::TypeOutlives(_))
@@ -584,6 +584,9 @@ pub enum Clause<'tcx> {
584584
/// Ensures that a const generic argument to a parameter `const N: u8`
585585
/// is of type `u8`.
586586
ConstArgHasType(Const<'tcx>, Ty<'tcx>),
587+
588+
/// No syntax: `T` well-formed.
589+
WellFormed(GenericArg<'tcx>),
587590
}
588591

589592
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable)]
@@ -592,9 +595,6 @@ pub enum PredicateKind<'tcx> {
592595
/// Prove a clause
593596
Clause(Clause<'tcx>),
594597

595-
/// No syntax: `T` well-formed.
596-
WellFormed(GenericArg<'tcx>),
597-
598598
/// Trait must be object-safe.
599599
ObjectSafe(DefId),
600600

@@ -1275,7 +1275,7 @@ impl<'tcx> Predicate<'tcx> {
12751275
| PredicateKind::Subtype(..)
12761276
| PredicateKind::Coerce(..)
12771277
| PredicateKind::Clause(Clause::RegionOutlives(..))
1278-
| PredicateKind::WellFormed(..)
1278+
| PredicateKind::Clause(Clause::WellFormed(..))
12791279
| PredicateKind::ObjectSafe(..)
12801280
| PredicateKind::ClosureKind(..)
12811281
| PredicateKind::Clause(Clause::TypeOutlives(..))
@@ -1296,7 +1296,7 @@ impl<'tcx> Predicate<'tcx> {
12961296
| PredicateKind::Subtype(..)
12971297
| PredicateKind::Coerce(..)
12981298
| PredicateKind::Clause(Clause::RegionOutlives(..))
1299-
| PredicateKind::WellFormed(..)
1299+
| PredicateKind::Clause(Clause::WellFormed(..))
13001300
| PredicateKind::ObjectSafe(..)
13011301
| PredicateKind::ClosureKind(..)
13021302
| PredicateKind::Clause(Clause::TypeOutlives(..))
@@ -1318,7 +1318,7 @@ impl<'tcx> Predicate<'tcx> {
13181318
| PredicateKind::Subtype(..)
13191319
| PredicateKind::Coerce(..)
13201320
| PredicateKind::Clause(Clause::RegionOutlives(..))
1321-
| PredicateKind::WellFormed(..)
1321+
| PredicateKind::Clause(Clause::WellFormed(..))
13221322
| PredicateKind::ObjectSafe(..)
13231323
| PredicateKind::ClosureKind(..)
13241324
| PredicateKind::ConstEvaluatable(..)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2877,7 +2877,7 @@ define_print_and_forward_display! {
28772877
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => {
28782878
p!("the constant `", print(ct), "` has type `", print(ty), "`")
28792879
},
2880-
ty::PredicateKind::WellFormed(arg) => p!(print(arg), " well-formed"),
2880+
ty::PredicateKind::Clause(ty::Clause::WellFormed(arg)) => p!(print(arg), " well-formed"),
28812881
ty::PredicateKind::ObjectSafe(trait_def_id) => {
28822882
p!("the trait `", print_def_path(trait_def_id, &[]), "` is object-safe")
28832883
}

compiler/rustc_middle/src/ty/structural_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ impl<'tcx> fmt::Debug for ty::Clause<'tcx> {
179179
ty::Clause::RegionOutlives(ref pair) => pair.fmt(f),
180180
ty::Clause::TypeOutlives(ref pair) => pair.fmt(f),
181181
ty::Clause::Projection(ref pair) => pair.fmt(f),
182+
ty::Clause::WellFormed(ref data) => write!(f, "WellFormed({:?})", data),
182183
}
183184
}
184185
}
@@ -189,7 +190,6 @@ impl<'tcx> fmt::Debug for ty::PredicateKind<'tcx> {
189190
ty::PredicateKind::Clause(ref a) => a.fmt(f),
190191
ty::PredicateKind::Subtype(ref pair) => pair.fmt(f),
191192
ty::PredicateKind::Coerce(ref pair) => pair.fmt(f),
192-
ty::PredicateKind::WellFormed(data) => write!(f, "WellFormed({:?})", data),
193193
ty::PredicateKind::ObjectSafe(trait_def_id) => {
194194
write!(f, "ObjectSafe({:?})", trait_def_id)
195195
}

compiler/rustc_privacy/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ where
183183
ty.visit_with(self)
184184
}
185185
ty::PredicateKind::ConstEvaluatable(ct) => ct.visit_with(self),
186-
ty::PredicateKind::WellFormed(arg) => arg.visit_with(self),
186+
ty::PredicateKind::Clause(ty::Clause::WellFormed(arg)) => arg.visit_with(self),
187187

188188
ty::PredicateKind::ObjectSafe(_)
189189
| ty::PredicateKind::ClosureKind(_, _, _)

compiler/rustc_trait_selection/src/solve/eval_ctxt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
319319
ty::PredicateKind::ObjectSafe(trait_def_id) => {
320320
self.compute_object_safe_goal(trait_def_id)
321321
}
322-
ty::PredicateKind::WellFormed(arg) => {
322+
ty::PredicateKind::Clause(ty::Clause::WellFormed(arg)) => {
323323
self.compute_well_formed_goal(Goal { param_env, predicate: arg })
324324
}
325325
ty::PredicateKind::Ambiguous => {

compiler/rustc_trait_selection/src/solve/fulfill.rs

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
119119
)
120120
}
121121
ty::PredicateKind::Clause(_)
122-
| ty::PredicateKind::WellFormed(_)
123122
| ty::PredicateKind::ObjectSafe(_)
124123
| ty::PredicateKind::ClosureKind(_, _, _)
125124
| ty::PredicateKind::ConstEvaluatable(_)

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
826826
// we start out with a `ParamEnv` with no inference variables,
827827
// and these don't correspond to adding any new bounds to
828828
// the `ParamEnv`.
829-
ty::PredicateKind::WellFormed(..)
829+
ty::PredicateKind::Clause(ty::Clause::WellFormed(..))
830830
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
831831
| ty::PredicateKind::AliasRelate(..)
832832
| ty::PredicateKind::ObjectSafe(..)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
10481048
self.report_closure_error(&obligation, closure_def_id, found_kind, kind)
10491049
}
10501050

1051-
ty::PredicateKind::WellFormed(ty) => {
1051+
ty::PredicateKind::Clause(ty::Clause::WellFormed(ty)) => {
10521052
match self.tcx.sess.opts.unstable_opts.trait_solver {
10531053
TraitSolver::Classic => {
10541054
// WF predicates cannot themselves make
@@ -2414,7 +2414,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
24142414
err
24152415
}
24162416

2417-
ty::PredicateKind::WellFormed(arg) => {
2417+
ty::PredicateKind::Clause(ty::Clause::WellFormed(arg)) => {
24182418
// Same hacky approach as above to avoid deluging user
24192419
// with error messages.
24202420
if arg.references_error()

compiler/rustc_trait_selection/src/traits/fulfill.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
354354
ty::PredicateKind::Clause(ty::Clause::RegionOutlives(_))
355355
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(_))
356356
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
357-
| ty::PredicateKind::WellFormed(_)
357+
| ty::PredicateKind::Clause(ty::Clause::WellFormed(_))
358358
| ty::PredicateKind::ObjectSafe(_)
359359
| ty::PredicateKind::ClosureKind(..)
360360
| ty::PredicateKind::Subtype(_)
@@ -433,7 +433,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
433433
}
434434
}
435435

436-
ty::PredicateKind::WellFormed(arg) => {
436+
ty::PredicateKind::Clause(ty::Clause::WellFormed(arg)) => {
437437
match wf::obligations(
438438
self.selcx.infcx,
439439
obligation.param_env,

compiler/rustc_trait_selection/src/traits/object_safety.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ fn predicate_references_self<'tcx>(
310310

311311
ty::PredicateKind::AliasRelate(..) => bug!("`AliasRelate` not allowed as assumption"),
312312

313-
ty::PredicateKind::WellFormed(..)
313+
ty::PredicateKind::Clause(ty::Clause::WellFormed(..))
314314
| ty::PredicateKind::ObjectSafe(..)
315315
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))
316316
| ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..))
@@ -361,7 +361,7 @@ fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
361361
| ty::PredicateKind::Subtype(..)
362362
| ty::PredicateKind::Coerce(..)
363363
| ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..))
364-
| ty::PredicateKind::WellFormed(..)
364+
| ty::PredicateKind::Clause(ty::Clause::WellFormed(..))
365365
| ty::PredicateKind::ObjectSafe(..)
366366
| ty::PredicateKind::ClosureKind(..)
367367
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))

0 commit comments

Comments
 (0)