1
Fork 0

make some rustc_feature internals private, and ensure invariants with debug assertions

This commit is contained in:
Ralf Jung 2024-10-09 08:30:43 +02:00
parent 46ce5cbf33
commit 1381773e01
6 changed files with 62 additions and 26 deletions

View file

@ -112,8 +112,8 @@ impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features {
fn hash_stable(&self, hcx: &mut StableHashingContext<'tcx>, hasher: &mut StableHasher) {
// Unfortunately we cannot exhaustively list fields here, since the
// struct is macro generated.
self.enabled_lang_features.hash_stable(hcx, hasher);
self.enabled_lib_features.hash_stable(hcx, hasher);
self.enabled_lang_features().hash_stable(hcx, hasher);
self.enabled_lib_features().hash_stable(hcx, hasher);
self.all_lang_features()[..].hash_stable(hcx, hasher);
for feature in rustc_feature::UNSTABLE_FEATURES.iter() {