@@ -649,18 +649,17 @@ impl<K: DepKind> DepGraph<K> {
649
649
impl < K : DepKind > DepGraphData < K > {
650
650
fn assert_dep_node_not_yet_allocated_in_current_session < S : std:: fmt:: Display > (
651
651
& self ,
652
- _dep_node : & DepNode < K > ,
653
- _msg : impl FnOnce ( ) -> S ,
652
+ dep_node : & DepNode < K > ,
653
+ msg : impl FnOnce ( ) -> S ,
654
654
) {
655
- #[ cfg( debug_assertions) ]
656
- if let Some ( prev_index) = self . previous . node_to_index_opt ( _dep_node) {
655
+ if let Some ( prev_index) = self . previous . node_to_index_opt ( dep_node) {
657
656
let current = self . current . prev_index_to_index . lock ( ) [ prev_index] ;
658
- assert ! ( current. is_none( ) , "{}" , _msg ( ) )
657
+ assert ! ( current. is_none( ) , "{}" , msg ( ) )
659
658
} else if let Some ( nodes_newly_allocated_in_current_session) =
660
659
& self . current . nodes_newly_allocated_in_current_session
661
660
{
662
- let seen = nodes_newly_allocated_in_current_session. lock ( ) . contains ( _dep_node ) ;
663
- assert ! ( !seen, "{}" , _msg ( ) ) ;
661
+ let seen = nodes_newly_allocated_in_current_session. lock ( ) . contains ( dep_node ) ;
662
+ assert ! ( !seen, "{}" , msg ( ) ) ;
664
663
}
665
664
}
666
665
@@ -980,9 +979,7 @@ impl<K: DepKind> DepGraph<K> {
980
979
dep_node : & DepNode < K > ,
981
980
msg : impl FnOnce ( ) -> S ,
982
981
) {
983
- if cfg ! ( debug_assertions)
984
- && let Some ( data) = & self . data
985
- {
982
+ if let Some ( data) = & self . data {
986
983
data. assert_dep_node_not_yet_allocated_in_current_session ( dep_node, msg)
987
984
}
988
985
}
@@ -1128,7 +1125,6 @@ pub(super) struct CurrentDepGraph<K: DepKind> {
1128
1125
///
1129
1126
/// The map contains all DepNodes that have been allocated in the current session so far and
1130
1127
/// for which there is no equivalent in the previous session.
1131
- #[ cfg( debug_assertions) ]
1132
1128
nodes_newly_allocated_in_current_session : Option < Lock < FxHashSet < DepNode < K > > > > ,
1133
1129
1134
1130
/// Anonymous `DepNode`s are nodes whose IDs we compute from the list of
@@ -1212,7 +1208,6 @@ impl<K: DepKind> CurrentDepGraph<K> {
1212
1208
forbidden_edge,
1213
1209
#[ cfg( debug_assertions) ]
1214
1210
fingerprints : Lock :: new ( IndexVec :: from_elem_n ( None , new_node_count_estimate) ) ,
1215
- #[ cfg( debug_assertions) ]
1216
1211
nodes_newly_allocated_in_current_session : session
1217
1212
. opts
1218
1213
. unstable_opts
@@ -1253,7 +1248,6 @@ impl<K: DepKind> CurrentDepGraph<K> {
1253
1248
#[ cfg( debug_assertions) ]
1254
1249
self . record_edge ( dep_node_index, key, current_fingerprint) ;
1255
1250
1256
- #[ cfg( debug_assertions) ]
1257
1251
if let Some ( ref nodes_newly_allocated_in_current_session) =
1258
1252
self . nodes_newly_allocated_in_current_session
1259
1253
{
0 commit comments