@@ -98,7 +98,7 @@ pub enum LintExpectationId {
9898 /// stable and can be cached. The additional index ensures that nodes with
9999 /// several expectations can correctly match diagnostics to the individual
100100 /// expectation.
101- Stable { hir_id : HirId , attr_index : u16 , lint_index : Option < u16 > , attr_id : Option < AttrId > } ,
101+ Stable { hir_id : HirId , attr_index : u16 , lint_index : Option < u16 > } ,
102102}
103103
104104impl LintExpectationId {
@@ -122,31 +122,13 @@ impl LintExpectationId {
122122
123123 * lint_index = new_lint_index
124124 }
125-
126- /// Prepares the id for hashing. Removes references to the ast.
127- /// Should only be called when the id is stable.
128- pub fn normalize ( self ) -> Self {
129- match self {
130- Self :: Stable { hir_id, attr_index, lint_index, .. } => {
131- Self :: Stable { hir_id, attr_index, lint_index, attr_id : None }
132- }
133- Self :: Unstable { .. } => {
134- unreachable ! ( "`normalize` called when `ExpectationId` is unstable" )
135- }
136- }
137- }
138125}
139126
140127impl < HCX : rustc_hir:: HashStableContext > HashStable < HCX > for LintExpectationId {
141128 #[ inline]
142129 fn hash_stable ( & self , hcx : & mut HCX , hasher : & mut StableHasher ) {
143130 match self {
144- LintExpectationId :: Stable {
145- hir_id,
146- attr_index,
147- lint_index : Some ( lint_index) ,
148- attr_id : _,
149- } => {
131+ LintExpectationId :: Stable { hir_id, attr_index, lint_index : Some ( lint_index) } => {
150132 hir_id. hash_stable ( hcx, hasher) ;
151133 attr_index. hash_stable ( hcx, hasher) ;
152134 lint_index. hash_stable ( hcx, hasher) ;
@@ -166,12 +148,9 @@ impl<HCX: rustc_hir::HashStableContext> ToStableHashKey<HCX> for LintExpectation
166148 #[ inline]
167149 fn to_stable_hash_key ( & self , _: & HCX ) -> Self :: KeyType {
168150 match self {
169- LintExpectationId :: Stable {
170- hir_id,
171- attr_index,
172- lint_index : Some ( lint_index) ,
173- attr_id : _,
174- } => ( * hir_id, * attr_index, * lint_index) ,
151+ LintExpectationId :: Stable { hir_id, attr_index, lint_index : Some ( lint_index) } => {
152+ ( * hir_id, * attr_index, * lint_index)
153+ }
175154 _ => {
176155 unreachable ! ( "HashStable should only be called for a filled `LintExpectationId`" )
177156 }
0 commit comments