diff options
| author | ismailarilik <arilik.ismail@gmail.com> | 2025-05-05 19:06:15 +0300 |
|---|---|---|
| committer | ismailarilik <arilik.ismail@gmail.com> | 2025-05-14 08:59:55 +0300 |
| commit | 85efae7302e9249bb29a6098f342ab176d0d63aa (patch) | |
| tree | 635deb15a9bd84dd4131facaba01b90c7c053a17 /compiler/rustc_query_system | |
| parent | 414482f6a0d4e7290f614300581a0b55442552a3 (diff) | |
| download | rust-85efae7302e9249bb29a6098f342ab176d0d63aa.tar.gz rust-85efae7302e9249bb29a6098f342ab176d0d63aa.zip | |
Handle `rustc_query_system` cases of `rustc::potential_query_instability` lint
Diffstat (limited to 'compiler/rustc_query_system')
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/graph.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/serialized.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/query/job.rs | 4 |
4 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 3ae56cef2c4..d4217e0aa54 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -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); } diff --git a/compiler/rustc_query_system/src/dep_graph/serialized.rs b/compiler/rustc_query_system/src/dep_graph/serialized.rs index f1b609a3ca9..79b99c52d0c 100644 --- a/compiler/rustc_query_system/src/dep_graph/serialized.rs +++ b/compiler/rustc_query_system/src/dep_graph/serialized.rs @@ -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)); diff --git a/compiler/rustc_query_system/src/lib.rs b/compiler/rustc_query_system/src/lib.rs index eba7378b475..d36cb6f0e5b 100644 --- a/compiler/rustc_query_system/src/lib.rs +++ b/compiler/rustc_query_system/src/lib.rs @@ -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)] diff --git a/compiler/rustc_query_system/src/query/job.rs b/compiler/rustc_query_system/src/query/job.rs index 6321abc5087..1e79bd461d2 100644 --- a/compiler/rustc_query_system/src/query/job.rs +++ b/compiler/rustc_query_system/src/query/job.rs @@ -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; |
