From 5843858c015614c92515f317ce93796c885ca2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Sun, 28 May 2023 15:47:44 +0200 Subject: [PATCH] Don't access self.mask with a single shard --- compiler/rustc_data_structures/src/sharded.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_data_structures/src/sharded.rs b/compiler/rustc_data_structures/src/sharded.rs index c16b9cbf8b7..9f5c97ae798 100644 --- a/compiler/rustc_data_structures/src/sharded.rs +++ b/compiler/rustc_data_structures/src/sharded.rs @@ -46,7 +46,7 @@ pub fn new(mut value: impl FnMut() -> T) -> Self { fn mask(&self) -> usize { #[cfg(parallel_compiler)] { - self.mask + if SHARDS == 1 { 0 } else { self.mask } } #[cfg(not(parallel_compiler))] {