Skip to content

Commit efd8724

Browse files
committed
Allow the lint for somewhere which seems that ordering affects nothing
1 parent 8430bcd commit efd8724

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/rustc_data_structures/src/sharded.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::borrow::Borrow;
2+
use std::collections::hash_map::RawEntryMut;
23
use std::hash::{Hash, Hasher};
34
use std::{iter, mem};
45

@@ -246,7 +247,7 @@ pub trait IntoPointer {
246247
fn into_pointer(&self) -> *const ();
247248
}
248249

249-
impl<K: Eq + Hash + Copy + IntoPointer> ShardedIndexMap<K, ()> {
250+
impl<K: Eq + Hash + Copy + IntoPointer> ShardedHashMap<K, ()> {
250251
pub fn contains_pointer_to<T: Hash + IntoPointer>(&self, value: &T) -> bool {
251252
let hash = make_hash(&value);
252253
let shard = self.lock_shard_by_hash(hash);

compiler/rustc_middle/src/ty/context.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_data_structures::fingerprint::Fingerprint;
2222
use rustc_data_structures::fx::FxHashMap;
2323
use rustc_data_structures::intern::Interned;
2424
use rustc_data_structures::profiling::SelfProfilerRef;
25-
use rustc_data_structures::sharded::{IntoPointer, ShardedIndexMap};
25+
use rustc_data_structures::sharded::{IntoPointer, ShardedHashMap};
2626
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
2727
use rustc_data_structures::steal::Steal;
2828
use rustc_data_structures::sync::{
@@ -787,7 +787,7 @@ impl<'tcx> rustc_type_ir::inherent::Span<TyCtxt<'tcx>> for Span {
787787
}
788788
}
789789

790-
type InternedSet<'tcx, T> = ShardedIndexMap<InternedInSet<'tcx, T>, ()>;
790+
type InternedSet<'tcx, T> = ShardedHashMap<InternedInSet<'tcx, T>, ()>;
791791

792792
pub struct CtxtInterners<'tcx> {
793793
/// The arena that types, regions, etc. are allocated from.
@@ -2377,6 +2377,8 @@ macro_rules! sty_debug_print {
23772377
$(let mut $variant = total;)*
23782378

23792379
for shard in tcx.interners.type_.lock_shards() {
2380+
// It seems that ordering doesn't affect anything here.
2381+
#[allow(rustc::potential_query_instability)]
23802382
let types = shard.iter();
23812383
for &(InternedInSet(t), ()) in types {
23822384
let variant = match t.internee {

0 commit comments

Comments
 (0)