Merge HostPolarity and BoundConstness

This commit is contained in:
Michael Goulet
2024-10-29 23:42:59 +00:00
parent 298c7462c3
commit 802f3a78a6
16 changed files with 66 additions and 81 deletions

View File

@@ -716,7 +716,7 @@ pub(super) fn assert_only_contains_predicates_from<'tcx>(
match clause.kind().skip_binder() {
ty::ClauseKind::HostEffect(ty::HostEffectPredicate {
trait_ref: _,
host: ty::HostPolarity::Maybe,
constness: ty::BoundConstness::Maybe,
}) => {}
_ => {
bug!(
@@ -732,8 +732,8 @@ pub(super) fn assert_only_contains_predicates_from<'tcx>(
match clause.kind().skip_binder() {
ty::ClauseKind::HostEffect(pred) => {
assert_eq!(
pred.host,
ty::HostPolarity::Maybe,
pred.constness,
ty::BoundConstness::Maybe,
"expected `~const` predicate when computing `{filter:?}` \
implied bounds: {clause:?}",
);
@@ -943,7 +943,7 @@ pub(super) fn const_conditions<'tcx>(
bounds.push_const_bound(
tcx,
ty::Binder::dummy(ty::TraitRef::identity(tcx, def_id.to_def_id())),
ty::HostPolarity::Maybe,
ty::BoundConstness::Maybe,
DUMMY_SP,
);
@@ -963,7 +963,7 @@ pub(super) fn const_conditions<'tcx>(
clause.kind().map_bound(|clause| match clause {
ty::ClauseKind::HostEffect(ty::HostEffectPredicate {
trait_ref,
host: ty::HostPolarity::Maybe,
constness: ty::BoundConstness::Maybe,
}) => trait_ref,
_ => bug!("converted {clause:?}"),
}),
@@ -1001,7 +1001,7 @@ pub(super) fn implied_const_bounds<'tcx>(
clause.kind().map_bound(|clause| match clause {
ty::ClauseKind::HostEffect(ty::HostEffectPredicate {
trait_ref,
host: ty::HostPolarity::Maybe,
constness: ty::BoundConstness::Maybe,
}) => trait_ref,
_ => bug!("converted {clause:?}"),
}),