From d121b34e9919dda5f1c2baa672459cbabbf05817 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Tue, 30 Mar 2021 20:31:06 +0200 Subject: [PATCH] Remove hir::CrateItem. --- clippy_lints/src/missing_doc.rs | 2 +- clippy_utils/src/lib.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clippy_lints/src/missing_doc.rs b/clippy_lints/src/missing_doc.rs index 5741aad261b..21b4983a1af 100644 --- a/clippy_lints/src/missing_doc.rs +++ b/clippy_lints/src/missing_doc.rs @@ -128,7 +128,7 @@ fn exit_lint_attrs(&mut self, _: &LateContext<'tcx>, _: &'tcx [ast::Attribute]) fn check_crate(&mut self, cx: &LateContext<'tcx>, krate: &'tcx hir::Crate<'_>) { let attrs = cx.tcx.hir().attrs(hir::CRATE_HIR_ID); - self.check_missing_docs_attrs(cx, attrs, krate.item.span, "the", "crate"); + self.check_missing_docs_attrs(cx, attrs, krate.item.inner, "the", "crate"); } fn check_item(&mut self, cx: &LateContext<'tcx>, it: &'tcx hir::Item<'_>) { diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index b2655f8d797..6b235875c20 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -61,10 +61,10 @@ use rustc_hir::def_id::{DefId, LOCAL_CRATE}; use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc_hir::{ - def, Arm, BindingAnnotation, Block, Body, Constness, CrateItem, Expr, ExprKind, FieldDef, FnDecl, ForeignItem, - GenericArgs, GenericParam, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, LangItem, Lifetime, Local, - MacroDef, MatchSource, Node, Param, Pat, PatKind, Path, PathSegment, QPath, Stmt, TraitItem, TraitItemKind, - TraitRef, TyKind, Variant, Visibility, + def, Arm, BindingAnnotation, Block, Body, Constness, Expr, ExprKind, FieldDef, FnDecl, ForeignItem, GenericArgs, + GenericParam, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, LangItem, Lifetime, Local, MacroDef, + MatchSource, Mod, Node, Param, Pat, PatKind, Path, PathSegment, QPath, Stmt, TraitItem, TraitItemKind, TraitRef, + TyKind, Variant, Visibility, }; use rustc_lint::{LateContext, Level, Lint, LintContext}; use rustc_middle::hir::exports::Export; @@ -743,7 +743,7 @@ pub fn get_node_span(node: Node<'_>) -> Option { | Node::Lifetime(Lifetime { span, .. }) | Node::GenericParam(GenericParam { span, .. }) | Node::Visibility(Visibility { span, .. }) - | Node::Crate(CrateItem { span, .. }) => Some(*span), + | Node::Crate(Mod { inner: span, .. }) => Some(*span), Node::Ctor(_) | Node::AnonConst(_) => None, } }