// the functions in `cgp` add the constrained parameters to a list of
// unconstrained parameters.
for (predicate, _) in impl_generic_predicates.predicates.iter() {
- if let ty::PredicateKind::Projection(proj) = predicate.kind() {
- let projection_ty = proj.skip_binder().projection_ty;
- let projected_ty = proj.skip_binder().ty;
+ if let ty::PredicateAtom::Projection(proj) = predicate.skip_binders() {
+ let projection_ty = proj.projection_ty;
+ let projected_ty = proj.ty;
let unbound_trait_ref = projection_ty.trait_ref(tcx);
if Some(unbound_trait_ref) == impl_trait_ref {
if let Some(obligations) = wf::obligations(
infcx,
tcx.param_env(impl1_def_id),
- tcx.hir().as_local_hir_id(impl1_def_id),
+ tcx.hir().local_def_id_to_hir_id(impl1_def_id),
arg,
span,
) {
fn check_specialization_on<'tcx>(tcx: TyCtxt<'tcx>, predicate: ty::Predicate<'tcx>, span: Span) {
debug!("can_specialize_on(predicate = {:?})", predicate);
- match predicate.kind() {
+ match predicate.skip_binders() {
// Global predicates are either always true or always false, so we
// are fine to specialize on.
_ if predicate.is_global() => (),
// We allow specializing on explicitly marked traits with no associated
// items.
- ty::PredicateKind::Trait(pred, hir::Constness::NotConst) => {
+ ty::PredicateAtom::Trait(pred, hir::Constness::NotConst) => {
if !matches!(
trait_predicate_kind(tcx, predicate),
Some(TraitSpecializationKind::Marker)
tcx: TyCtxt<'tcx>,
predicate: ty::Predicate<'tcx>,
) -> Option<TraitSpecializationKind> {
- match predicate.kind() {
- ty::PredicateKind::Trait(pred, hir::Constness::NotConst) => {
+ match predicate.skip_binders() {
+ ty::PredicateAtom::Trait(pred, hir::Constness::NotConst) => {
Some(tcx.trait_def(pred.def_id()).specialization_kind)
}
- ty::PredicateKind::Trait(_, hir::Constness::Const)
- | ty::PredicateKind::RegionOutlives(_)
- | ty::PredicateKind::TypeOutlives(_)
- | ty::PredicateKind::Projection(_)
- | ty::PredicateKind::WellFormed(_)
- | ty::PredicateKind::Subtype(_)
- | ty::PredicateKind::ObjectSafe(_)
- | ty::PredicateKind::ClosureKind(..)
- | ty::PredicateKind::ConstEvaluatable(..)
- | ty::PredicateKind::ConstEquate(..) => None,
+ ty::PredicateAtom::Trait(_, hir::Constness::Const)
+ | ty::PredicateAtom::RegionOutlives(_)
+ | ty::PredicateAtom::TypeOutlives(_)
+ | ty::PredicateAtom::Projection(_)
+ | ty::PredicateAtom::WellFormed(_)
+ | ty::PredicateAtom::Subtype(_)
+ | ty::PredicateAtom::ObjectSafe(_)
+ | ty::PredicateAtom::ClosureKind(..)
+ | ty::PredicateAtom::ConstEvaluatable(..)
+ | ty::PredicateAtom::ConstEquate(..) => None,
}
}