@@ -98,7 +98,7 @@ pub enum LintExpectationId {
98
98
/// stable and can be cached. The additional index ensures that nodes with
99
99
/// several expectations can correctly match diagnostics to the individual
100
100
/// 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 > } ,
102
102
}
103
103
104
104
impl LintExpectationId {
@@ -122,31 +122,13 @@ impl LintExpectationId {
122
122
123
123
* lint_index = new_lint_index
124
124
}
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
- }
138
125
}
139
126
140
127
impl < HCX : rustc_hir:: HashStableContext > HashStable < HCX > for LintExpectationId {
141
128
#[ inline]
142
129
fn hash_stable ( & self , hcx : & mut HCX , hasher : & mut StableHasher ) {
143
130
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) } => {
150
132
hir_id. hash_stable ( hcx, hasher) ;
151
133
attr_index. hash_stable ( hcx, hasher) ;
152
134
lint_index. hash_stable ( hcx, hasher) ;
@@ -166,12 +148,9 @@ impl<HCX: rustc_hir::HashStableContext> ToStableHashKey<HCX> for LintExpectation
166
148
#[ inline]
167
149
fn to_stable_hash_key ( & self , _: & HCX ) -> Self :: KeyType {
168
150
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
+ }
175
154
_ => {
176
155
unreachable ! ( "HashStable should only be called for a filled `LintExpectationId`" )
177
156
}
0 commit comments