File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
compiler/rustc_query_system/src/dep_graph Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1339,6 +1339,8 @@ impl<K: DepKind> CurrentDepGraph<K> {
13391339 prev_graph : & SerializedDepGraph < K > ,
13401340 prev_index : SerializedDepNodeIndex ,
13411341 ) -> DepNodeIndex {
1342+ self . debug_assert_not_in_new_nodes ( prev_graph, prev_index) ;
1343+
13421344 let mut prev_index_to_index = self . prev_index_to_index . lock ( ) ;
13431345
13441346 match prev_index_to_index[ prev_index] {
@@ -1359,6 +1361,22 @@ impl<K: DepKind> CurrentDepGraph<K> {
13591361 }
13601362 }
13611363 }
1364+
1365+ #[ inline]
1366+ fn debug_assert_not_in_new_nodes (
1367+ & self ,
1368+ prev_graph : & SerializedDepGraph < K > ,
1369+ prev_index : SerializedDepNodeIndex ,
1370+ ) {
1371+ let node = & prev_graph. index_to_node ( prev_index) ;
1372+ debug_assert ! (
1373+ !self
1374+ . nodes_newly_allocated_in_current_session
1375+ . as_ref( )
1376+ . map_or( false , |set| set. lock( ) . contains( node) ) ,
1377+ "node from previous graph present in new node collection"
1378+ ) ;
1379+ }
13621380}
13631381
13641382/// The capacity of the `reads` field `SmallVec`
You can’t perform that action at this time.
0 commit comments