Skip to content

Commit ebe184a

Browse files
committed
Auto merge of rust-lang#98084 - nnethercote:rm-thread-local-IGNORED_ATTRIBUTES, r=michaelwoerister
Remove thread-local `IGNORED_ATTRIBUTES`. It's just a copy of the read-only global `ich::IGNORED_ATTRIBUTES`, and can be removed without any effect. r? `@michaelwoerister`
2 parents 389352c + a280162 commit ebe184a

File tree

1 file changed

+1
-10
lines changed
  • compiler/rustc_query_system/src/ich

1 file changed

+1
-10
lines changed

compiler/rustc_query_system/src/ich/hcx.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::ich;
22
use rustc_ast as ast;
3-
use rustc_data_structures::fx::FxHashSet;
43
use rustc_data_structures::sorted_map::SortedMap;
54
use rustc_data_structures::stable_hasher::{HashStable, HashingControls, StableHasher};
65
use rustc_data_structures::sync::Lrc;
@@ -13,11 +12,6 @@ use rustc_span::source_map::SourceMap;
1312
use rustc_span::symbol::Symbol;
1413
use rustc_span::{BytePos, CachingSourceMapView, SourceFile, Span, SpanData};
1514

16-
fn compute_ignored_attr_names() -> FxHashSet<Symbol> {
17-
debug_assert!(!ich::IGNORED_ATTRIBUTES.is_empty());
18-
ich::IGNORED_ATTRIBUTES.iter().copied().collect()
19-
}
20-
2115
/// This is the context state available during incr. comp. hashing. It contains
2216
/// enough information to transform `DefId`s and `HirId`s into stable `DefPath`s (i.e.,
2317
/// a reference to the `TyCtxt`) and it holds a few caches for speeding up various
@@ -161,10 +155,7 @@ impl<'a> StableHashingContext<'a> {
161155

162156
#[inline]
163157
pub fn is_ignored_attr(&self, name: Symbol) -> bool {
164-
thread_local! {
165-
static IGNORED_ATTRIBUTES: FxHashSet<Symbol> = compute_ignored_attr_names();
166-
}
167-
IGNORED_ATTRIBUTES.with(|attrs| attrs.contains(&name))
158+
ich::IGNORED_ATTRIBUTES.contains(&name)
168159
}
169160

170161
#[inline]

0 commit comments

Comments
 (0)