Skip to content

Commit

Permalink
Auto merge of #99334 - NiklasJonsson:84447/error-privacy, r=oli-obk
Browse files Browse the repository at this point in the history
rustc_error, rustc_private: Switch to stable hash containers

Relates rust-lang/rust#84447
  • Loading branch information
bors committed Sep 12, 2022
2 parents 42361da + 41b3084 commit 4e313a5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clippy_lints/src/matches/match_same_arms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4e313a5

Please sign in to comment.