let impl2_substs = translate_substs(infcx, param_env, impl1_def_id, impl1_substs, impl2_node);
// Conservatively use an empty `ParamEnv`.
- let outlives_env = OutlivesEnvironment::new(tcx, ty::ParamEnv::empty());
+ let outlives_env = OutlivesEnvironment::new(ty::ParamEnv::empty());
infcx.resolve_regions_and_report_errors(impl1_def_id, &outlives_env, RegionckMode::default());
let impl2_substs = match infcx.fully_resolve(&impl2_substs) {
Ok(s) => s,
// 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.ignore_qualifiers(tcx).skip_binder().kind()
- {
+ if let ty::PredicateAtom::Projection(proj) = predicate.skip_binders() {
let projection_ty = proj.projection_ty;
let projected_ty = proj.ty;
fn check_specialization_on<'tcx>(tcx: TyCtxt<'tcx>, predicate: ty::Predicate<'tcx>, span: Span) {
debug!("can_specialize_on(predicate = {:?})", predicate);
- match predicate.ignore_qualifiers(tcx).skip_binder().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.ignore_qualifiers(tcx).skip_binder().kind() {
- ty::PredicateKind::ForAll(_) => bug!("unexpected predicate: {:?}", predicate),
- 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,
}
}