File tree Expand file tree Collapse file tree
compiler/rustc_middle/src/dep_graph Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,9 +164,10 @@ impl DepGraph {
164164 ) ;
165165 assert_eq ! ( red_node_index, DepNodeIndex :: FOREVER_RED_NODE ) ;
166166 if prev_graph_node_count > 0 {
167- colors. insert_red ( SerializedDepNodeIndex :: from_u32 (
168- DepNodeIndex :: FOREVER_RED_NODE . as_u32 ( ) ,
169- ) ) ;
167+ let prev_index =
168+ const { SerializedDepNodeIndex :: from_u32 ( DepNodeIndex :: FOREVER_RED_NODE . as_u32 ( ) ) } ;
169+ let result = colors. try_set_color ( prev_index, DesiredColor :: Red ) ;
170+ assert_matches ! ( result, TrySetColorResult :: Success ) ;
170171 }
171172
172173 DepGraph {
@@ -1455,13 +1456,6 @@ impl DepNodeColorMap {
14551456 DepNodeColor :: Unknown
14561457 }
14571458 }
1458-
1459- #[ inline]
1460- pub ( super ) fn insert_red ( & self , index : SerializedDepNodeIndex ) {
1461- let value = self . values [ index] . swap ( COMPRESSED_RED , Ordering :: Release ) ;
1462- // Sanity check for duplicate nodes
1463- assert_eq ! ( value, COMPRESSED_UNKNOWN , "tried to color an already colored node as red" ) ;
1464- }
14651459}
14661460
14671461/// The color that [`DepNodeColorMap::try_set_color`] should try to apply to a node.
You can’t perform that action at this time.
0 commit comments