use crate::traits::util::impl_subject_and_oblig;
use crate::traits::SkipLeakCheck;
use crate::traits::{
- self, Normalized, Obligation, ObligationCause, ObligationCtxt, PredicateObligation,
- PredicateObligations, SelectionContext,
+ self, Obligation, ObligationCause, ObligationCtxt, PredicateObligation, PredicateObligations,
+ SelectionContext,
};
use rustc_data_structures::fx::FxIndexSet;
use rustc_errors::Diagnostic;
use std::iter;
use std::ops::ControlFlow;
+use super::NormalizeExt;
+
/// Whether we do the orphan check relative to this crate or
/// to some remote crate.
#[derive(Copy, Clone, Debug)]
predicates: tcx.predicates_of(impl_def_id).instantiate(tcx, impl_substs).predicates,
};
- let Normalized { value: mut header, obligations } =
- traits::normalize(selcx, param_env, ObligationCause::dummy(), header);
+ let InferOk { value: mut header, obligations } =
+ selcx.infcx.at(&ObligationCause::dummy(), param_env).normalize(header);
header.predicates.extend(obligations.into_iter().map(|o| o.predicate));
header
| ty::RawPtr(..)
| ty::Never
| ty::Tuple(..)
- | ty::Projection(..) => self.found_non_local_ty(ty),
+ | ty::Alias(ty::Projection, ..) => self.found_non_local_ty(ty),
ty::Param(..) => self.found_param_ty(ty),
);
ControlFlow::Break(OrphanCheckEarlyExit::LocalTy(ty))
}
- ty::Opaque(..) => {
+ ty::Alias(ty::Opaque, ..) => {
// This merits some explanation.
// Normally, opaque types are not involved when performing
// coherence checking, since it is illegal to directly