From e2edce0221ecef2ef1aaa2e58158730151e58f53 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 3 Feb 2026 15:34:29 +1100 Subject: [PATCH] Remove `rustc_span::HashStableContext::hash_spans`. It reads the `HashingControls::span` field, but there is also the `hashing_controls` method. No need to have two different ways of doing it. --- compiler/rustc_query_system/src/ich/hcx.rs | 5 ----- compiler/rustc_span/src/lib.rs | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/compiler/rustc_query_system/src/ich/hcx.rs b/compiler/rustc_query_system/src/ich/hcx.rs index fb73178a726b..ec416b8f807c 100644 --- a/compiler/rustc_query_system/src/ich/hcx.rs +++ b/compiler/rustc_query_system/src/ich/hcx.rs @@ -85,11 +85,6 @@ impl<'a> HashStable> for ast::NodeId { } impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> { - #[inline] - fn hash_spans(&self) -> bool { - self.hashing_controls.hash_spans - } - #[inline] fn unstable_opts_incremental_ignore_spans(&self) -> bool { self.incremental_ignore_spans diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index a178f3260d30..0ad80b9d7879 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -2799,7 +2799,6 @@ impl InnerSpan { /// instead of implementing everything in rustc_middle. pub trait HashStableContext { fn def_path_hash(&self, def_id: DefId) -> DefPathHash; - fn hash_spans(&self) -> bool; /// Accesses `sess.opts.unstable_opts.incremental_ignore_spans` since /// we don't have easy access to a `Session` fn unstable_opts_incremental_ignore_spans(&self) -> bool; @@ -2832,7 +2831,7 @@ where const TAG_INVALID_SPAN: u8 = 1; const TAG_RELATIVE_SPAN: u8 = 2; - if !ctx.hash_spans() { + if !ctx.hashing_controls().hash_spans { return; }