diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index f0cc9636b75c2..3b6a1706febb8 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -1396,7 +1396,7 @@ impl DepNodeColorMap { let value = self.values[index].load(Ordering::Acquire); // Green is by far the most common case. Check for that first so we can succeed with a // single comparison. - if value < COMPRESSED_RED { + if value <= DepNodeIndex::MAX_AS_U32 { DepNodeColor::Green(DepNodeIndex::from_u32(value)) } else if value == COMPRESSED_RED { DepNodeColor::Red