Skip to content

Commit 355fe75

Browse files
Rollup merge of rust-lang#112667 - compiler-errors:wf-goal-is-clause, r=lcnr
Move WF/ConstEvaluatable goal to clause It can show up in a param-env, so I think it needs to be a clause kind. r? `@lcnr` or `@oli-obk`
2 parents 9589d43 + 4343d36 commit 355fe75

File tree

40 files changed

+719
-685
lines changed

40 files changed

+719
-685
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
);

0 commit comments

Comments
 (0)