X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_lint%2Fsrc%2Ftypes.rs;h=b0a5d3674ad2795d75fdcefe041c68c2db19f7de;hb=c3b1f5428b7ed8b5e75e5ac8e4e26a46093a7965;hp=15062afec72f23a388c868476c9027d305fc7579;hpb=3175d03d3b07eb7a16455477117796ff76b8e691;p=rust.git diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 15062afec72..b0a5d3674ad 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -1239,9 +1239,8 @@ fn check_foreign_fn(&mut self, def_id: LocalDefId, decl: &hir::FnDecl<'_>) { } } - fn check_foreign_static(&mut self, id: hir::HirId, span: Span) { - let def_id = self.cx.tcx.hir().local_def_id(id); - let ty = self.cx.tcx.type_of(def_id); + fn check_foreign_static(&mut self, id: hir::OwnerId, span: Span) { + let ty = self.cx.tcx.type_of(id); self.check_type_for_ffi_and_report_errors(span, ty, true, false); } @@ -1264,7 +1263,7 @@ fn check_foreign_item(&mut self, cx: &LateContext<'_>, it: &hir::ForeignItem<'_> vis.check_foreign_fn(it.owner_id.def_id, decl); } hir::ForeignItemKind::Static(ref ty, _) => { - vis.check_foreign_static(it.hir_id(), ty.span); + vis.check_foreign_static(it.owner_id, ty.span); } hir::ForeignItemKind::Type => (), }