Skip to content

Commit 3fb9baf

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

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
@@ -1424,6 +1424,8 @@ fn panic_on_forbidden_read<D: Deps>(data: &DepGraphData<D>, dep_node_index: DepN
14241424
&& let Some(nodes) = &data.current.nodes_in_current_session
14251425
{
14261426
// Try to find it among the nodes allocated so far in this session
1427+
// This is OK, there's only ever one node result possible so this is deterministic.
1428+
#[allow(rustc::potential_query_instability)]
14271429
if let Some((node, _)) = nodes.lock().iter().find(|&(_, index)| *index == dep_node_index) {
14281430
dep_node = Some(*node);
14291431
}

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

+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)