From 58dd2e5969d0b83a029c25a68b2577726d2392d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Fri, 23 Jan 2026 15:01:07 +0100 Subject: [PATCH] Tweak bounds check in `DepNodeColorMap.get` --- compiler/rustc_query_system/src/dep_graph/graph.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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