diff options
| author | bors <bors@rust-lang.org> | 2023-11-29 02:45:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-29 02:45:36 +0000 |
| commit | f440b5f0ea042cb2087a36631b20878f9847ee28 (patch) | |
| tree | cf204a92b3b76b64caf3fa66661373e473792da0 /compiler/rustc_query_system/src | |
| parent | b1e56deadaf4b08cd591feaa1a1283348298427d (diff) | |
| parent | 1487bd6a174f813967ffff6b3334b4fe296f1f30 (diff) | |
| download | rust-f440b5f0ea042cb2087a36631b20878f9847ee28.tar.gz rust-f440b5f0ea042cb2087a36631b20878f9847ee28.zip | |
Auto merge of #118348 - Mark-Simulacrum:feature-code-size, r=compiler-errors
Cut code size for feature hashing This locally cuts ~32 kB of .text instructions. This isn't really a clear win in terms of readability. IMO the code size benefits are worth it (even if they're not necessarily present in the x86_64 hyperoptimized build, I expect them to translate similarly to other platforms). Ultimately there's lots of "small ish" low hanging fruit like this that I'm seeing that seems worth tackling to me, and could translate into larger wins in aggregate.
Diffstat (limited to 'compiler/rustc_query_system/src')
| -rw-r--r-- | compiler/rustc_query_system/src/ich/impls_syntax.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_query_system/src/ich/impls_syntax.rs b/compiler/rustc_query_system/src/ich/impls_syntax.rs index 81a7eb604f5..f2387017c82 100644 --- a/compiler/rustc_query_system/src/ich/impls_syntax.rs +++ b/compiler/rustc_query_system/src/ich/impls_syntax.rs @@ -117,9 +117,9 @@ impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features { self.declared_lang_features.hash_stable(hcx, hasher); self.declared_lib_features.hash_stable(hcx, hasher); - self.walk_feature_fields(|feature_name, value| { - feature_name.hash_stable(hcx, hasher); - value.hash_stable(hcx, hasher); - }); + self.all_features()[..].hash_stable(hcx, hasher); + for feature in rustc_feature::UNSTABLE_FEATURES.iter() { + feature.feature.name.hash_stable(hcx, hasher); + } } } |
