File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
compiler/rustc_query_system/src/dep_graph Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1363,7 +1363,10 @@ impl DepNodeColorMap {
13631363 Ordering :: Relaxed ,
13641364 ) {
13651365 Ok ( _) => Ok ( ( ) ) ,
1366- Err ( v) => Err ( DepNodeIndex :: from_u32 ( v) ) ,
1366+ Err ( v) => Err ( {
1367+ assert_ne ! ( v, COMPRESSED_RED , "tried to mark a red node as green" ) ;
1368+ DepNodeIndex :: from_u32 ( v)
1369+ } ) ,
13671370 }
13681371 }
13691372
@@ -1384,7 +1387,9 @@ impl DepNodeColorMap {
13841387
13851388 #[ inline]
13861389 pub ( super ) fn insert_red ( & self , index : SerializedDepNodeIndex ) {
1387- self . values [ index] . store ( COMPRESSED_RED , Ordering :: Release )
1390+ let value = self . values [ index] . swap ( COMPRESSED_RED , Ordering :: Release ) ;
1391+ // Sanity check for duplicate nodes
1392+ assert_eq ! ( value, COMPRESSED_UNKNOWN , "trying to encode a dep node twice" ) ;
13881393 }
13891394}
13901395
You can’t perform that action at this time.
0 commit comments