Skip to content

Commit

Permalink
Remove thread-local IGNORED_ATTRIBUTES.
Browse files Browse the repository at this point in the history
It's just a copy of the read-only global `ich::IGNORED_ATTRIBUTES`, and
can be removed without any effect.
  • Loading branch information
nnethercote committed Jun 14, 2022
1 parent ca122c7 commit a280162
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions compiler/rustc_query_system/src/ich/hcx.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::ich;
use rustc_ast as ast;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sorted_map::SortedMap;
use rustc_data_structures::stable_hasher::{HashStable, HashingControls, StableHasher};
use rustc_data_structures::sync::Lrc;
Expand All @@ -13,11 +12,6 @@ use rustc_span::source_map::SourceMap;
use rustc_span::symbol::Symbol;
use rustc_span::{BytePos, CachingSourceMapView, SourceFile, Span, SpanData};

fn compute_ignored_attr_names() -> FxHashSet<Symbol> {
debug_assert!(!ich::IGNORED_ATTRIBUTES.is_empty());
ich::IGNORED_ATTRIBUTES.iter().copied().collect()
}

/// This is the context state available during incr. comp. hashing. It contains
/// enough information to transform `DefId`s and `HirId`s into stable `DefPath`s (i.e.,
/// a reference to the `TyCtxt`) and it holds a few caches for speeding up various
Expand Down Expand Up @@ -161,10 +155,7 @@ impl<'a> StableHashingContext<'a> {

#[inline]
pub fn is_ignored_attr(&self, name: Symbol) -> bool {
thread_local! {
static IGNORED_ATTRIBUTES: FxHashSet<Symbol> = compute_ignored_attr_names();
}
IGNORED_ATTRIBUTES.with(|attrs| attrs.contains(&name))
ich::IGNORED_ATTRIBUTES.contains(&name)
}

#[inline]
Expand Down

0 comments on commit a280162

Please sign in to comment.