Introduce Enabled{Lang,Lib}Feature
Instead of passing around random n-tuples of e.g. `(gate_name, attr_sp, since)`.
This commit is contained in:
@@ -116,3 +116,20 @@ impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features {
|
||||
self.enabled_lib_features().hash_stable(hcx, hasher);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::EnabledLangFeature {
|
||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'tcx>, hasher: &mut StableHasher) {
|
||||
let rustc_feature::EnabledLangFeature { gate_name, attr_sp, stable_since } = self;
|
||||
gate_name.hash_stable(hcx, hasher);
|
||||
attr_sp.hash_stable(hcx, hasher);
|
||||
stable_since.hash_stable(hcx, hasher);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::EnabledLibFeature {
|
||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'tcx>, hasher: &mut StableHasher) {
|
||||
let rustc_feature::EnabledLibFeature { gate_name, attr_sp } = self;
|
||||
gate_name.hash_stable(hcx, hasher);
|
||||
attr_sp.hash_stable(hcx, hasher);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user