@@ -3,12 +3,11 @@ use std::fmt::Display;
33
44use rustc_data_structures:: fx:: FxIndexSet ;
55use rustc_data_structures:: stable_hasher:: {
6- StableCompare , StableHash , StableHashCtxt , StableHasher , ToStableHashKey ,
6+ StableCompare , StableHash , StableHashCtxt , StableHasher ,
77} ;
88use rustc_error_messages:: { DiagArgValue , IntoDiagArg } ;
9- use rustc_hir_id:: { HirId , ItemLocalId } ;
9+ use rustc_hir_id:: HirId ;
1010use rustc_macros:: { Decodable , Encodable , StableHash } ;
11- use rustc_span:: def_id:: DefPathHash ;
1211pub use rustc_span:: edition:: Edition ;
1312use rustc_span:: { AttrId , Ident , Symbol , sym} ;
1413use serde:: { Deserialize , Serialize } ;
@@ -154,23 +153,6 @@ impl StableHash for LintExpectationId {
154153 }
155154}
156155
157- impl ToStableHashKey for LintExpectationId {
158- type KeyType = ( DefPathHash , ItemLocalId , u16 , u16 ) ;
159-
160- #[ inline]
161- fn to_stable_hash_key < Hcx : StableHashCtxt > ( & self , hcx : & mut Hcx ) -> Self :: KeyType {
162- match self {
163- LintExpectationId :: Stable { hir_id, attr_index, lint_index : Some ( lint_index) } => {
164- let ( def_path_hash, lint_idx) = hir_id. to_stable_hash_key ( hcx) ;
165- ( def_path_hash, lint_idx, * attr_index, * lint_index)
166- }
167- _ => {
168- unreachable ! ( "StableHash should only be called for a filled `LintExpectationId`" )
169- }
170- }
171- }
172- }
173-
174156/// Setting for how to handle a lint.
175157///
176158/// See: <https://doc.rust-lang.org/rustc/lints/levels.html>
@@ -623,15 +605,6 @@ impl StableHash for LintId {
623605 }
624606}
625607
626- impl ToStableHashKey for LintId {
627- type KeyType = & ' static str ;
628-
629- #[ inline]
630- fn to_stable_hash_key < Hcx > ( & self , _: & mut Hcx ) -> & ' static str {
631- self . lint_name_raw ( )
632- }
633- }
634-
635608impl StableCompare for LintId {
636609 const CAN_USE_UNSTABLE_SORT : bool = true ;
637610
0 commit comments