diff options
| author | bors <bors@rust-lang.org> | 2022-09-12 15:57:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-12 15:57:37 +0000 |
| commit | 4e313a50b20ad3a2eaabceecb3505b523202c750 (patch) | |
| tree | fa46af5c7f29e50da82ceb418babd2432e62a9a9 | |
| parent | 42361da5d976297cf856de606916812390c298ca (diff) | |
| parent | 41b30843910b160c0daa69d737cac46ed2c13f09 (diff) | |
| download | rust-4e313a50b20ad3a2eaabceecb3505b523202c750.tar.gz rust-4e313a50b20ad3a2eaabceecb3505b523202c750.zip | |
Auto merge of #99334 - NiklasJonsson:84447/error-privacy, r=oli-obk
rustc_error, rustc_private: Switch to stable hash containers Relates https://github.com/rust-lang/rust/issues/84447
| -rw-r--r-- | clippy_lints/src/matches/match_same_arms.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clippy_lints/src/matches/match_same_arms.rs b/clippy_lints/src/matches/match_same_arms.rs index 93874b103b4..d37f44d4a17 100644 --- a/clippy_lints/src/matches/match_same_arms.rs +++ b/clippy_lints/src/matches/match_same_arms.rs @@ -8,11 +8,10 @@ use rustc_arena::DroplessArena; use rustc_ast::ast::LitKind; use rustc_errors::Applicability; use rustc_hir::def_id::DefId; -use rustc_hir::{Arm, Expr, ExprKind, HirId, HirIdMap, HirIdSet, Pat, PatKind, RangeEnd}; +use rustc_hir::{Arm, Expr, ExprKind, HirId, HirIdMap, HirIdMapEntry, HirIdSet, Pat, PatKind, RangeEnd}; use rustc_lint::LateContext; use rustc_middle::ty; use rustc_span::Symbol; -use std::collections::hash_map::Entry; use super::MATCH_SAME_ARMS; @@ -71,9 +70,9 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) { if let Some(a_id) = path_to_local(a); if let Some(b_id) = path_to_local(b); let entry = match local_map.entry(a_id) { - Entry::Vacant(entry) => entry, + HirIdMapEntry::Vacant(entry) => entry, // check if using the same bindings as before - Entry::Occupied(entry) => return *entry.get() == b_id, + HirIdMapEntry::Occupied(entry) => return *entry.get() == b_id, }; // the names technically don't have to match; this makes the lint more conservative if cx.tcx.hir().name(a_id) == cx.tcx.hir().name(b_id); |
