Handle rustc_query_system cases of rustc::potential_query_instability lint
This commit is contained in:
@@ -1433,6 +1433,8 @@ fn panic_on_forbidden_read<D: Deps>(data: &DepGraphData<D>, dep_node_index: DepN
|
||||
&& let Some(nodes) = &data.current.nodes_in_current_session
|
||||
{
|
||||
// Try to find it among the nodes allocated so far in this session
|
||||
// This is OK, there's only ever one node result possible so this is deterministic.
|
||||
#[allow(rustc::potential_query_instability)]
|
||||
if let Some((node, _)) = nodes.lock().iter().find(|&(_, index)| *index == dep_node_index) {
|
||||
dep_node = Some(*node);
|
||||
}
|
||||
|
||||
@@ -784,6 +784,8 @@ impl<D: Deps> EncoderState<D> {
|
||||
) {
|
||||
if let Some(record_stats) = &self.stats {
|
||||
let record_stats = record_stats.lock();
|
||||
// `stats` is sorted below so we can allow this lint here.
|
||||
#[allow(rustc::potential_query_instability)]
|
||||
let mut stats: Vec<_> = record_stats.values().collect();
|
||||
stats.sort_by_key(|s| -(s.node_counter as i64));
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// tidy-alphabetical-start
|
||||
#![allow(rustc::potential_query_instability, internal_features)]
|
||||
#![allow(internal_features)]
|
||||
#![feature(assert_matches)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(dropck_eyepatch)]
|
||||
|
||||
@@ -510,6 +510,10 @@ pub fn break_query_cycles<I: Clone + Debug>(
|
||||
registry: &rayon_core::Registry,
|
||||
) {
|
||||
let mut wakelist = Vec::new();
|
||||
// It is OK per the comments:
|
||||
// - https://github.com/rust-lang/rust/pull/131200#issuecomment-2798854932
|
||||
// - https://github.com/rust-lang/rust/pull/131200#issuecomment-2798866392
|
||||
#[allow(rustc::potential_query_instability)]
|
||||
let mut jobs: Vec<QueryJobId> = query_map.keys().cloned().collect();
|
||||
|
||||
let mut found_cycle = false;
|
||||
|
||||
Reference in New Issue
Block a user