Skip to content

Commit bbe1567

Browse files
committed
Auto merge of #7043 - camsteffen:dead-utils, r=flip1995
Remove some dead utils changelog: none
2 parents 6ae0835 + 79d3082 commit bbe1567

File tree

2 files changed

+4
-41
lines changed

2 files changed

+4
-41
lines changed

clippy_utils/src/lib.rs

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
6060
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
6161
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
6262
use rustc_hir::{
63-
def, Arm, BindingAnnotation, Block, Body, Constness, CrateItem, Expr, ExprKind, FieldDef, FnDecl, ForeignItem,
64-
GenericArgs, GenericParam, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, LangItem, Lifetime, Local,
65-
MacroDef, MatchSource, Node, Param, Pat, PatKind, Path, PathSegment, QPath, Stmt, TraitItem, TraitItemKind,
66-
TraitRef, TyKind, Variant, Visibility,
63+
def, Arm, BindingAnnotation, Block, Body, Constness, Expr, ExprKind, FnDecl, GenericArgs, HirId, Impl, ImplItem,
64+
ImplItemKind, Item, ItemKind, LangItem, MatchSource, Node, Param, Pat, PatKind, Path, PathSegment, QPath,
65+
TraitItem, TraitItemKind, TraitRef, TyKind,
6766
};
6867
use rustc_lint::{LateContext, Level, Lint, LintContext};
6968
use rustc_middle::hir::exports::Export;
@@ -75,7 +74,7 @@ use rustc_session::Session;
7574
use rustc_span::hygiene::{ExpnKind, MacroKind};
7675
use rustc_span::source_map::original_sp;
7776
use rustc_span::sym;
78-
use rustc_span::symbol::{kw, Ident, Symbol};
77+
use rustc_span::symbol::{kw, Symbol};
7978
use rustc_span::{Span, DUMMY_SP};
8079
use rustc_target::abi::Integer;
8180

@@ -712,41 +711,6 @@ fn line_span<T: LintContext>(cx: &T, span: Span) -> Span {
712711
Span::new(line_start, span.hi(), span.ctxt())
713712
}
714713

715-
/// Gets the span of the node, if there is one.
716-
pub fn get_node_span(node: Node<'_>) -> Option<Span> {
717-
match node {
718-
Node::Param(Param { span, .. })
719-
| Node::Item(Item { span, .. })
720-
| Node::ForeignItem(ForeignItem { span, .. })
721-
| Node::TraitItem(TraitItem { span, .. })
722-
| Node::ImplItem(ImplItem { span, .. })
723-
| Node::Variant(Variant { span, .. })
724-
| Node::Field(FieldDef { span, .. })
725-
| Node::Expr(Expr { span, .. })
726-
| Node::Stmt(Stmt { span, .. })
727-
| Node::PathSegment(PathSegment {
728-
ident: Ident { span, .. },
729-
..
730-
})
731-
| Node::Ty(hir::Ty { span, .. })
732-
| Node::TraitRef(TraitRef {
733-
path: Path { span, .. },
734-
..
735-
})
736-
| Node::Binding(Pat { span, .. })
737-
| Node::Pat(Pat { span, .. })
738-
| Node::Arm(Arm { span, .. })
739-
| Node::Block(Block { span, .. })
740-
| Node::Local(Local { span, .. })
741-
| Node::MacroDef(MacroDef { span, .. })
742-
| Node::Lifetime(Lifetime { span, .. })
743-
| Node::GenericParam(GenericParam { span, .. })
744-
| Node::Visibility(Visibility { span, .. })
745-
| Node::Crate(CrateItem { span, .. }) => Some(*span),
746-
Node::Ctor(_) | Node::AnonConst(_) => None,
747-
}
748-
}
749-
750714
/// Gets the parent node, if any.
751715
pub fn get_parent_node(tcx: TyCtxt<'_>, id: HirId) -> Option<Node<'_>> {
752716
tcx.hir().parent_iter(id).next().map(|(_, node)| node)

clippy_utils/src/paths.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ pub(super) const PANIC_ANY: [&str; 3] = ["std", "panic", "panic_any"];
9393
pub const PARKING_LOT_MUTEX_GUARD: [&str; 2] = ["parking_lot", "MutexGuard"];
9494
pub const PARKING_LOT_RWLOCK_READ_GUARD: [&str; 2] = ["parking_lot", "RwLockReadGuard"];
9595
pub const PARKING_LOT_RWLOCK_WRITE_GUARD: [&str; 2] = ["parking_lot", "RwLockWriteGuard"];
96-
pub const PATH_BUF: [&str; 3] = ["std", "path", "PathBuf"];
9796
pub const PATH_BUF_AS_PATH: [&str; 4] = ["std", "path", "PathBuf", "as_path"];
9897
pub const PATH_TO_PATH_BUF: [&str; 4] = ["std", "path", "Path", "to_path_buf"];
9998
pub const PERMISSIONS: [&str; 3] = ["std", "fs", "Permissions"];

0 commit comments

Comments
 (0)