Rename local_did to def_id

Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
This commit is contained in:
Miguel Guarniz 2022-07-19 17:06:52 -04:00
parent 25bdc8965e
commit 16513d689e
9 changed files with 28 additions and 24 deletions

View file

@ -207,10 +207,14 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
constness,
);
let body_id = local_did
.and_then(|id| tcx.hir().maybe_body_owned_by(id).map(|body| body.hir_id))
.or(hir_id)
.map_or(hir::CRATE_HIR_ID, |did| did);
let body_id =
local_did.and_then(|id| tcx.hir().maybe_body_owned_by(id).map(|body| body.hir_id));
let body_id = match body_id {
Some(id) => id,
None if hir_id.is_some() => hir_id.unwrap(),
_ => hir::CRATE_HIR_ID,
};
let cause = traits::ObligationCause::misc(tcx.def_span(def_id), body_id);
traits::normalize_param_env_or_error(tcx, unnormalized_env, cause)
}