X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_passes%2Fsrc%2Fcheck_attr.rs;h=25cc65ba04c8b7ca083695b7426179bf41208939;hb=192eecd53a41bb32f2a44a854697835ff67ee890;hp=42329853259459ead163c2e4e7c70fc28084be19;hpb=f3644ca64de6357a07a3901dd2dacbda247beec6;p=rust.git diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 42329853259..25cc65ba04c 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -453,7 +453,9 @@ fn check_cmse_nonsecure_entry( /// Debugging aid for `object_lifetime_default` query. fn check_object_lifetime_default(&self, hir_id: HirId) { let tcx = self.tcx; - if let Some(generics) = tcx.hir().get_generics(tcx.hir().local_def_id(hir_id)) { + if let Some(owner_id) = hir_id.as_owner() + && let Some(generics) = tcx.hir().get_generics(owner_id.def_id) + { for p in generics.params { let hir::GenericParamKind::Type { .. } = p.kind else { continue }; let default = tcx.object_lifetime_default(p.def_id); @@ -1943,7 +1945,7 @@ fn check_rustc_allow_const_fn_unstable( ) -> bool { match target { Target::Fn | Target::Method(_) - if self.tcx.is_const_fn_raw(self.tcx.hir().local_def_id(hir_id).to_def_id()) => + if self.tcx.is_const_fn_raw(hir_id.expect_owner().to_def_id()) => { true } @@ -2120,7 +2122,8 @@ fn check_proc_macro(&self, hir_id: HirId, target: Target, kind: ProcMacroKind) { let id = hir_id.expect_owner(); let hir_sig = tcx.hir().fn_sig_by_hir_id(hir_id).unwrap(); - let sig = tcx.liberate_late_bound_regions(id.to_def_id(), tcx.fn_sig(id)); + let sig = + tcx.liberate_late_bound_regions(id.to_def_id(), tcx.fn_sig(id).subst_identity()); let sig = tcx.normalize_erasing_regions(ParamEnv::empty(), sig); // We don't currently require that the function signature is equal to