Skip to content

Commit 9e33b69

Browse files
Rollup merge of rust-lang#114772 - fee1-dead-contrib:typed-did, r=b-naber
Add `{Local}ModDefId` to more strongly type DefIds` Based on rust-lang#110862 by `@Nilstrieb`
2 parents b8b3e07 + 7c87e5c commit 9e33b69

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_utils/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ use rustc_ast::Attribute;
8383
use rustc_data_structures::fx::FxHashMap;
8484
use rustc_data_structures::unhash::UnhashMap;
8585
use rustc_hir::def::{DefKind, Res};
86-
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
86+
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LocalModDefId, LOCAL_CRATE};
8787
use rustc_hir::hir_id::{HirIdMap, HirIdSet};
8888
use rustc_hir::intravisit::{walk_expr, FnKind, Visitor};
8989
use rustc_hir::LangItem::{OptionNone, OptionSome, ResultErr, ResultOk};
@@ -2370,11 +2370,11 @@ pub fn is_hir_ty_cfg_dependant(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool {
23702370
false
23712371
}
23722372

2373-
static TEST_ITEM_NAMES_CACHE: OnceLock<Mutex<FxHashMap<LocalDefId, Vec<Symbol>>>> = OnceLock::new();
2373+
static TEST_ITEM_NAMES_CACHE: OnceLock<Mutex<FxHashMap<LocalModDefId, Vec<Symbol>>>> = OnceLock::new();
23742374

2375-
fn with_test_item_names(tcx: TyCtxt<'_>, module: LocalDefId, f: impl Fn(&[Symbol]) -> bool) -> bool {
2375+
fn with_test_item_names(tcx: TyCtxt<'_>, module: LocalModDefId, f: impl Fn(&[Symbol]) -> bool) -> bool {
23762376
let cache = TEST_ITEM_NAMES_CACHE.get_or_init(|| Mutex::new(FxHashMap::default()));
2377-
let mut map: MutexGuard<'_, FxHashMap<LocalDefId, Vec<Symbol>>> = cache.lock().unwrap();
2377+
let mut map: MutexGuard<'_, FxHashMap<LocalModDefId, Vec<Symbol>>> = cache.lock().unwrap();
23782378
let value = map.entry(module);
23792379
match value {
23802380
Entry::Occupied(entry) => f(entry.get()),

0 commit comments

Comments
 (0)