Skip to content

Commit 006a142

Browse files
authored
Rollup merge of #132076 - RalfJung:feature-hashing, r=nnethercote,Mark-Simulacrum
HashStable for rustc_feature::Features: stop hashing compile-time constant It seems like back in 542bc75 this was added as "hash the boolean value of each lang feature", but then in 1487bd6 this got split into first hashing a sequence of `bool`s (representing all the features) and then hashing all the feature names... but the list of feature names is a compile-time constant, so it seems entirely unnecessary to hash them? Cc `@Mark-Simulacrum` who wrote the second of the commits mentioned above. Cc `@nnethercote`
2 parents 8f354fc + 0304809 commit 006a142

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/rustc_query_system/src/ich/impls_syntax.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,8 @@ impl<'a> HashStable<StableHashingContext<'a>> for SourceFile {
111111
impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features {
112112
fn hash_stable(&self, hcx: &mut StableHashingContext<'tcx>, hasher: &mut StableHasher) {
113113
// Unfortunately we cannot exhaustively list fields here, since the
114-
// struct is macro generated.
114+
// struct has private fields (to ensure its invariant is maintained)
115115
self.enabled_lang_features().hash_stable(hcx, hasher);
116116
self.enabled_lib_features().hash_stable(hcx, hasher);
117-
118-
// FIXME: why do we hash something that is a compile-time constant?
119-
for feature in rustc_feature::UNSTABLE_LANG_FEATURES.iter() {
120-
feature.name.hash_stable(hcx, hasher);
121-
}
122117
}
123118
}

0 commit comments

Comments
 (0)