File tree 1 file changed +18
-0
lines changed
compiler/rustc_query_system/src/dep_graph
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> {
1339
1339
prev_graph : & SerializedDepGraph < K > ,
1340
1340
prev_index : SerializedDepNodeIndex ,
1341
1341
) -> DepNodeIndex {
1342
+ self . debug_assert_not_in_new_nodes ( prev_graph, prev_index) ;
1343
+
1342
1344
let mut prev_index_to_index = self . prev_index_to_index . lock ( ) ;
1343
1345
1344
1346
match prev_index_to_index[ prev_index] {
@@ -1359,6 +1361,22 @@ impl<K: DepKind> CurrentDepGraph<K> {
1359
1361
}
1360
1362
}
1361
1363
}
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
+ }
1362
1380
}
1363
1381
1364
1382
/// The capacity of the `reads` field `SmallVec`
You can’t perform that action at this time.
0 commit comments