@@ -95,7 +95,7 @@ pub enum LintExpectationId {
95
95
/// stable and can be cached. The additional index ensures that nodes with
96
96
/// several expectations can correctly match diagnostics to the individual
97
97
/// expectation.
98
- Stable { hir_id : HirId , attr_index : u16 , lint_index : Option < u16 > , attr_id : Option < AttrId > } ,
98
+ Stable { hir_id : HirId , attr_index : u16 , lint_index : Option < u16 > } ,
99
99
}
100
100
101
101
impl LintExpectationId {
@@ -119,31 +119,13 @@ impl LintExpectationId {
119
119
120
120
* lint_index = new_lint_index
121
121
}
122
-
123
- /// Prepares the id for hashing. Removes references to the ast.
124
- /// Should only be called when the id is stable.
125
- pub fn normalize ( self ) -> Self {
126
- match self {
127
- Self :: Stable { hir_id, attr_index, lint_index, .. } => {
128
- Self :: Stable { hir_id, attr_index, lint_index, attr_id : None }
129
- }
130
- Self :: Unstable { .. } => {
131
- unreachable ! ( "`normalize` called when `ExpectationId` is unstable" )
132
- }
133
- }
134
- }
135
122
}
136
123
137
124
impl < HCX : rustc_hir:: HashStableContext > HashStable < HCX > for LintExpectationId {
138
125
#[ inline]
139
126
fn hash_stable ( & self , hcx : & mut HCX , hasher : & mut StableHasher ) {
140
127
match self {
141
- LintExpectationId :: Stable {
142
- hir_id,
143
- attr_index,
144
- lint_index : Some ( lint_index) ,
145
- attr_id : _,
146
- } => {
128
+ LintExpectationId :: Stable { hir_id, attr_index, lint_index : Some ( lint_index) } => {
147
129
hir_id. hash_stable ( hcx, hasher) ;
148
130
attr_index. hash_stable ( hcx, hasher) ;
149
131
lint_index. hash_stable ( hcx, hasher) ;
@@ -163,12 +145,9 @@ impl<HCX: rustc_hir::HashStableContext> ToStableHashKey<HCX> for LintExpectation
163
145
#[ inline]
164
146
fn to_stable_hash_key ( & self , _: & HCX ) -> Self :: KeyType {
165
147
match self {
166
- LintExpectationId :: Stable {
167
- hir_id,
168
- attr_index,
169
- lint_index : Some ( lint_index) ,
170
- attr_id : _,
171
- } => ( * hir_id, * attr_index, * lint_index) ,
148
+ LintExpectationId :: Stable { hir_id, attr_index, lint_index : Some ( lint_index) } => {
149
+ ( * hir_id, * attr_index, * lint_index)
150
+ }
172
151
_ => {
173
152
unreachable ! ( "HashStable should only be called for a filled `LintExpectationId`" )
174
153
}
0 commit comments