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:
parent
5ae4d75eff
commit
3528149f73
7 changed files with 101 additions and 51 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue