Skip to content

Commit 85efae7

Browse files
committed
Handle rustc_query_system cases of rustc::potential_query_instability lint
1 parent 414482f commit 85efae7

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

compiler/rustc_query_system/src/dep_graph/graph.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,8 @@ fn panic_on_forbidden_read<D: Deps>(data: &DepGraphData<D>, dep_node_index: DepN
14331433
&& let Some(nodes) = &data.current.nodes_in_current_session
14341434
{
14351435
// Try to find it among the nodes allocated so far in this session
1436+
// This is OK, there's only ever one node result possible so this is deterministic.
1437+
#[allow(rustc::potential_query_instability)]
14361438
if let Some((node, _)) = nodes.lock().iter().find(|&(_, index)| *index == dep_node_index) {
14371439
dep_node = Some(*node);
14381440
}

compiler/rustc_query_system/src/dep_graph/serialized.rs

+2
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,8 @@ impl<D: Deps> EncoderState<D> {
784784
) {
785785
if let Some(record_stats) = &self.stats {
786786
let record_stats = record_stats.lock();
787+
// `stats` is sorted below so we can allow this lint here.
788+
#[allow(rustc::potential_query_instability)]
787789
let mut stats: Vec<_> = record_stats.values().collect();
788790
stats.sort_by_key(|s| -(s.node_counter as i64));
789791

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
#![feature(assert_matches)]
44
#![feature(core_intrinsics)]
55
#![feature(dropck_eyepatch)]

compiler/rustc_query_system/src/query/job.rs

+4
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,10 @@ pub fn break_query_cycles<I: Clone + Debug>(
510510
registry: &rayon_core::Registry,
511511
) {
512512
let mut wakelist = Vec::new();
513+
// It is OK per the comments:
514+
// - https://github.com/rust-lang/rust/pull/131200#issuecomment-2798854932
515+
// - https://github.com/rust-lang/rust/pull/131200#issuecomment-2798866392
516+
#[allow(rustc::potential_query_instability)]
513517
let mut jobs: Vec<QueryJobId> = query_map.keys().cloned().collect();
514518

515519
let mut found_cycle = false;

0 commit comments

Comments
 (0)