Skip to content

Commit 358ae92

Browse files
authored
Rollup merge of rust-lang#152655 - zetanumbers:disable_debug_assert_151509, r=nnethercote
Disable debug_assert_not_in_new_nodes for multiple threads Fixes rust-lang#152654 This debug assertion is no longer intended to succeed for the parallel compiler since rust-lang#151509 doesn't panic on a red-green query graph coloring race, generating both red and green nodes (rust-lang#151509 (comment))
2 parents ca2655c + 9fb9225 commit 358ae92

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • compiler/rustc_middle/src/dep_graph

compiler/rustc_middle/src/dep_graph/graph.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
99
use rustc_data_structures::profiling::QueryInvocationId;
1010
use rustc_data_structures::sharded::{self, ShardedHashMap};
1111
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
12-
use rustc_data_structures::sync::{AtomicU64, Lock};
12+
use rustc_data_structures::sync::{AtomicU64, Lock, is_dyn_thread_safe};
1313
use rustc_data_structures::unord::UnordMap;
1414
use rustc_data_structures::{assert_matches, outline};
1515
use rustc_errors::DiagInner;
@@ -1302,7 +1302,9 @@ impl CurrentDepGraph {
13021302
prev_graph: &SerializedDepGraph,
13031303
prev_index: SerializedDepNodeIndex,
13041304
) {
1305-
if let Some(ref nodes_in_current_session) = self.nodes_in_current_session {
1305+
if !is_dyn_thread_safe()
1306+
&& let Some(ref nodes_in_current_session) = self.nodes_in_current_session
1307+
{
13061308
debug_assert!(
13071309
!nodes_in_current_session
13081310
.lock()

0 commit comments

Comments
 (0)