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))] {