// except according to those terms.
use middle::free_region::FreeRegionMap;
-use middle::infer;
+use middle::infer::{self, TypeOrigin};
use middle::traits;
use middle::ty::{self};
use middle::subst::{self, Subst, Substs, VecPerParamSpace};
// Create a parameter environment that represents the implementation's
// method.
- let impl_param_env =
- ty::ParameterEnvironment::for_item(tcx, impl_m.def_id.node);
+ let impl_m_node_id = tcx.map.as_local_node_id(impl_m.def_id).unwrap();
+ let impl_param_env = ty::ParameterEnvironment::for_item(tcx, impl_m_node_id);
// Create mapping from impl to skolemized.
let impl_to_skol_substs = &impl_param_env.free_substs;
let trait_fty = trait_fty.subst(tcx, &trait_to_skol_substs);
let err = infcx.commit_if_ok(|snapshot| {
- let origin = infer::MethodCompatCheck(impl_m_span);
+ let origin = TypeOrigin::MethodCompatCheck(impl_m_span);
let (impl_sig, _) =
infcx.replace_late_bound_regions_with_fresh_var(impl_m_span,
// Create a parameter environment that represents the implementation's
// method.
- let impl_param_env =
- ty::ParameterEnvironment::for_item(tcx, impl_c.def_id.node);
+ let impl_c_node_id = tcx.map.as_local_node_id(impl_c.def_id).unwrap();
+ let impl_param_env = ty::ParameterEnvironment::for_item(tcx, impl_c_node_id);
// Create mapping from impl to skolemized.
let impl_to_skol_substs = &impl_param_env.free_substs;
let trait_ty = trait_c.ty.subst(tcx, &trait_to_skol_substs);
let err = infcx.commit_if_ok(|_| {
- let origin = infer::Misc(impl_c_span);
+ let origin = TypeOrigin::Misc(impl_c_span);
// There is no "body" here, so just pass dummy id.
let impl_ty =