Skip to content

Commit 552eed0

Browse files
committed
Handle rustc_query_system cases of rustc::potential_query_instability lint
1 parent 0eb0b8c commit 552eed0

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

compiler/rustc_data_structures/src/fx.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::hash::BuildHasherDefault;
22

3+
pub use indexmap::map::RawEntryApiV1 as IndexRawEntryApiV1;
34
pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
45

56
pub type StdEntry<'a, K, V> = std::collections::hash_map::Entry<'a, K, V>;

compiler/rustc_query_system/src/dep_graph/graph.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::assert_matches::assert_matches;
2+
use std::collections::hash_map::Entry;
23
use std::fmt::Debug;
34
use std::hash::Hash;
45
use std::marker::PhantomData;

compiler/rustc_query_system/src/dep_graph/serialized.rs

+2
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ impl<D: Deps> GraphEncoder<D> {
719719
let mut status = self.status.lock();
720720
let status = status.as_mut().unwrap();
721721
if let Some(record_stats) = &status.stats {
722+
// `stats` is sorted below so we can allow this lint here.
723+
#[allow(rustc::potential_query_instability)]
722724
let mut stats: Vec<_> = record_stats.values().collect();
723725
stats.sort_by_key(|s| -(s.node_counter as i64));
724726

compiler/rustc_query_system/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// tidy-alphabetical-start
2-
#![allow(rustc::potential_query_instability, internal_features)]
2+
#![allow(internal_features)]
33
#![cfg_attr(bootstrap, feature(let_chains))]
44
#![feature(assert_matches)]
55
#![feature(core_intrinsics)]

compiler/rustc_query_system/src/query/job.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::num::NonZero;
66
use std::sync::Arc;
77

88
use parking_lot::{Condvar, Mutex};
9-
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
9+
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
1010
use rustc_errors::{Diag, DiagCtxtHandle};
1111
use rustc_hir::def::DefKind;
1212
use rustc_session::Session;
@@ -35,7 +35,7 @@ impl<I> QueryInfo<I> {
3535
}
3636
}
3737

38-
pub type QueryMap<I> = FxHashMap<QueryJobId, QueryJobInfo<I>>;
38+
pub type QueryMap<I> = FxIndexMap<QueryJobId, QueryJobInfo<I>>;
3939

4040
/// A value uniquely identifying an active query job.
4141
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]

0 commit comments

Comments
 (0)