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.
This commit is contained in:
commit
f440b5f0ea
2 changed files with 14 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue