use rustc_ast::ast;
use rustc_hir::def_id::DefId;
+use rustc_middle::traits::ObligationCause;
use rustc_middle::ty::error::TypeError;
use rustc_middle::ty::relate::{self, Relate, RelateResult, TypeRelation};
use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::{self, InferConst, ToPredicate, Ty, TyCtxt, TypeFoldable};
use rustc_middle::ty::{IntType, UintType};
-use rustc_span::{Span, DUMMY_SP};
+use rustc_span::DUMMY_SP;
#[derive(Clone)]
pub struct CombineFields<'infcx, 'tcx> {
self.obligations.push(Obligation::new(
self.trace.cause.clone(),
self.param_env,
- ty::PredicateKind::WellFormed(b_ty.into()).to_predicate(self.infcx.tcx),
+ ty::PredicateAtom::WellFormed(b_ty.into()).to_predicate(self.infcx.tcx),
));
}
};
debug!("generalize: for_universe = {:?}", for_universe);
+ debug!("generalize: trace = {:?}", self.trace);
let mut generalize = Generalizer {
infcx: self.infcx,
- span: self.trace.cause.span,
+ cause: &self.trace.cause,
for_vid_sub_root: self.infcx.inner.borrow_mut().type_variables().sub_root_var(for_vid),
for_universe,
ambient_variance,
b: &'tcx ty::Const<'tcx>,
) {
let predicate = if a_is_expected {
- ty::PredicateKind::ConstEquate(a, b)
+ ty::PredicateAtom::ConstEquate(a, b)
} else {
- ty::PredicateKind::ConstEquate(b, a)
+ ty::PredicateAtom::ConstEquate(b, a)
};
self.obligations.push(Obligation::new(
self.trace.cause.clone(),
infcx: &'cx InferCtxt<'cx, 'tcx>,
/// The span, used when creating new type variables and things.
- span: Span,
+ cause: &'cx ObligationCause<'tcx>,
/// The vid of the type variable that is in the process of being
/// instantiated; if we find this within the type we are folding,
// FIXME: This is non-ideal because we don't give a
// very descriptive origin for this region variable.
- Ok(self.infcx.next_region_var_in_universe(MiscVariable(self.span), self.for_universe))
+ Ok(self.infcx.next_region_var_in_universe(MiscVariable(self.cause.span), self.for_universe))
}
fn consts(