1
Fork 0

remove an unused DefId

This commit is contained in:
lcnr 2022-06-27 17:18:49 +02:00
parent a3beeaa84d
commit 24799e3720
11 changed files with 28 additions and 74 deletions

View file

@ -208,8 +208,7 @@ fn compare_predicate_entailment<'tcx>(
Reveal::UserFacing,
hir::Constness::NotConst,
);
let param_env =
traits::normalize_param_env_or_error(tcx, impl_m.def_id, param_env, normalize_cause);
let param_env = traits::normalize_param_env_or_error(tcx, param_env, normalize_cause);
tcx.infer_ctxt().enter(|infcx| {
let inh = Inherited::new(infcx, impl_m.def_id.expect_local());
@ -1247,12 +1246,7 @@ fn compare_type_predicate_entailment<'tcx>(
Reveal::UserFacing,
hir::Constness::NotConst,
);
let param_env = traits::normalize_param_env_or_error(
tcx,
impl_ty.def_id,
param_env,
normalize_cause.clone(),
);
let param_env = traits::normalize_param_env_or_error(tcx, param_env, normalize_cause.clone());
tcx.infer_ctxt().enter(|infcx| {
let inh = Inherited::new(infcx, impl_ty.def_id.expect_local());
let infcx = &inh.infcx;

View file

@ -222,10 +222,8 @@ pub struct RegionCtxt<'a, 'tcx> {
// id of innermost fn body id
body_id: hir::HirId,
// TODO: is this always equal to `body_id`?
body_owner: LocalDefId,
// id of AST node being analyzed (the subject of the analysis).
subject_def_id: LocalDefId,
}
impl<'a, 'tcx> Deref for RegionCtxt<'a, 'tcx> {
@ -245,13 +243,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
param_env: ty::ParamEnv<'tcx>,
) -> RegionCtxt<'a, 'tcx> {
let outlives_environment = OutlivesEnvironment::new(param_env);
RegionCtxt {
fcx,
body_id: initial_body_id,
body_owner: subject,
subject_def_id: subject,
outlives_environment,
}
RegionCtxt { fcx, body_id: initial_body_id, body_owner: subject, outlives_environment }
}
/// Try to resolve the type for the given node, returning `t_err` if an error results. Note that
@ -369,10 +361,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
self.param_env,
);
self.fcx.resolve_regions_and_report_errors(
self.subject_def_id.to_def_id(),
&self.outlives_environment,
);
self.fcx.resolve_regions_and_report_errors(&self.outlives_environment);
}
fn constrain_bindings_in_pat(&mut self, pat: &hir::Pat<'_>) {

View file

@ -661,7 +661,7 @@ fn resolve_regions_with_wf_tys<'tcx>(
add_constraints(&infcx, region_bound_pairs);
let errors = infcx.resolve_regions(id.expect_owner().to_def_id(), &outlives_environment);
let errors = infcx.resolve_regions(&outlives_environment);
debug!(?errors, "errors");

View file

@ -349,7 +349,7 @@ fn visit_implementation_of_dispatch_from_dyn<'tcx>(tcx: TyCtxt<'tcx>, impl_did:
// Finally, resolve all regions.
let outlives_env = OutlivesEnvironment::new(param_env);
infcx.resolve_regions_and_report_errors(impl_did.to_def_id(), &outlives_env);
infcx.resolve_regions_and_report_errors(&outlives_env);
}
}
_ => {
@ -606,7 +606,7 @@ pub fn coerce_unsized_info<'tcx>(tcx: TyCtxt<'tcx>, impl_did: DefId) -> CoerceUn
// Finally, resolve all regions.
let outlives_env = OutlivesEnvironment::new(param_env);
infcx.resolve_regions_and_report_errors(impl_did.to_def_id(), &outlives_env);
infcx.resolve_regions_and_report_errors(&outlives_env);
CoerceUnsizedInfo { custom_kind: kind }
})

View file

@ -150,7 +150,7 @@ fn get_impl_substs<'tcx>(
// Conservatively use an empty `ParamEnv`.
let outlives_env = OutlivesEnvironment::new(ty::ParamEnv::empty());
infcx.resolve_regions_and_report_errors(impl1_def_id.to_def_id(), &outlives_env);
infcx.resolve_regions_and_report_errors(&outlives_env);
let Ok(impl2_substs) = infcx.fully_resolve(impl2_substs) else {
let span = tcx.def_span(impl1_def_id);
tcx.sess.emit_err(SubstsOnOverriddenImpl { span });