Fix rustc_hash ambiguity in miri

There are two rustc_hash crates in the sysroot when building miri and
there is no way to disambiguate between the two. Instead use the
re-exports of it in the rustc_data_structures crate.
This commit is contained in:
bjorn3 2025-11-24 19:22:37 +00:00
parent 00ec159c71
commit d10216a3a8
4 changed files with 5 additions and 6 deletions

View file

@ -1,6 +1,6 @@
use std::hash::BuildHasherDefault;
pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
pub use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet, FxHasher};
pub type StdEntry<'a, K, V> = std::collections::hash_map::Entry<'a, K, V>;

View file

@ -3,8 +3,8 @@ use std::num::NonZero;
use std::sync::Mutex;
use rustc_abi::{Align, Size};
use rustc_data_structures::fx::{FxBuildHasher, FxHashSet};
use rustc_errors::{Diag, DiagMessage, Level};
use rustc_hash::FxHashSet;
use rustc_span::{DUMMY_SP, Span, SpanData, Symbol};
use crate::borrow_tracker::stacked_borrows::diagnostics::TagHistory;
@ -878,6 +878,6 @@ pub struct SpanDedupDiagnostic(Mutex<FxHashSet<Span>>);
impl SpanDedupDiagnostic {
pub const fn new() -> Self {
Self(Mutex::new(FxHashSet::with_hasher(rustc_hash::FxBuildHasher)))
Self(Mutex::new(FxHashSet::with_hasher(FxBuildHasher)))
}
}

View file

@ -6,7 +6,7 @@ use std::{cmp, iter};
use rand::RngCore;
use rustc_abi::{Align, ExternAbi, FieldIdx, FieldsShape, Size, Variants};
use rustc_apfloat::Float;
use rustc_hash::FxHashSet;
use rustc_data_structures::fx::{FxBuildHasher, FxHashSet};
use rustc_hir::Safety;
use rustc_hir::def::{DefKind, Namespace};
use rustc_hir::def_id::{CRATE_DEF_INDEX, CrateNum, DefId, LOCAL_CRATE};
@ -647,7 +647,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
RejectOpWith::WarningWithoutBacktrace => {
// Deduplicate these warnings *by shim* (not by span)
static DEDUP: Mutex<FxHashSet<String>> =
Mutex::new(FxHashSet::with_hasher(rustc_hash::FxBuildHasher));
Mutex::new(FxHashSet::with_hasher(FxBuildHasher));
let mut emitted_warnings = DEDUP.lock().unwrap();
if !emitted_warnings.contains(op_name) {
// First time we are seeing this.

View file

@ -57,7 +57,6 @@ extern crate rustc_codegen_ssa;
extern crate rustc_const_eval;
extern crate rustc_data_structures;
extern crate rustc_errors;
extern crate rustc_hash;
extern crate rustc_hir;
extern crate rustc_index;
extern crate rustc_log;