Remove hir::CrateItem.

This commit is contained in:
Camille GILLOT 2021-03-30 20:31:06 +02:00
parent a57a8c3058
commit d121b34e99
2 changed files with 6 additions and 6 deletions

View File

@ -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<'_>) {

View File

@ -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<Span> {
| 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,
}
}