1
1
use crate :: ich;
2
2
use crate :: middle:: cstore:: CrateStore ;
3
- use crate :: ty:: { fast_reject , TyCtxt } ;
3
+ use crate :: ty:: TyCtxt ;
4
4
5
5
use rustc_ast as ast;
6
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
6
+ use rustc_data_structures:: fx:: FxHashSet ;
7
7
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
8
8
use rustc_data_structures:: sync:: Lrc ;
9
9
use rustc_hir as hir;
@@ -14,9 +14,6 @@ use rustc_span::source_map::SourceMap;
14
14
use rustc_span:: symbol:: Symbol ;
15
15
use rustc_span:: { BytePos , CachingSourceMapView , SourceFile , Span , SpanData } ;
16
16
17
- use smallvec:: SmallVec ;
18
- use std:: cmp:: Ord ;
19
-
20
17
fn compute_ignored_attr_names ( ) -> FxHashSet < Symbol > {
21
18
debug_assert ! ( !ich:: IGNORED_ATTRIBUTES . is_empty( ) ) ;
22
19
ich:: IGNORED_ATTRIBUTES . iter ( ) . copied ( ) . collect ( )
@@ -241,39 +238,3 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> {
241
238
}
242
239
243
240
impl rustc_session:: HashStableContext for StableHashingContext < ' a > { }
244
-
245
- pub fn hash_stable_trait_impls < ' a > (
246
- hcx : & mut StableHashingContext < ' a > ,
247
- hasher : & mut StableHasher ,
248
- blanket_impls : & [ DefId ] ,
249
- non_blanket_impls : & FxHashMap < fast_reject:: SimplifiedType , Vec < DefId > > ,
250
- ) {
251
- {
252
- let mut blanket_impls: SmallVec < [ _ ; 8 ] > =
253
- blanket_impls. iter ( ) . map ( |& def_id| hcx. def_path_hash ( def_id) ) . collect ( ) ;
254
-
255
- if blanket_impls. len ( ) > 1 {
256
- blanket_impls. sort_unstable ( ) ;
257
- }
258
-
259
- blanket_impls. hash_stable ( hcx, hasher) ;
260
- }
261
-
262
- {
263
- let mut keys: SmallVec < [ _ ; 8 ] > =
264
- non_blanket_impls. keys ( ) . map ( |k| ( k, k. map_def ( |d| hcx. def_path_hash ( d) ) ) ) . collect ( ) ;
265
- keys. sort_unstable_by ( |& ( _, ref k1) , & ( _, ref k2) | k1. cmp ( k2) ) ;
266
- keys. len ( ) . hash_stable ( hcx, hasher) ;
267
- for ( key, ref stable_key) in keys {
268
- stable_key. hash_stable ( hcx, hasher) ;
269
- let mut impls: SmallVec < [ _ ; 8 ] > =
270
- non_blanket_impls[ key] . iter ( ) . map ( |& impl_id| hcx. def_path_hash ( impl_id) ) . collect ( ) ;
271
-
272
- if impls. len ( ) > 1 {
273
- impls. sort_unstable ( ) ;
274
- }
275
-
276
- impls. hash_stable ( hcx, hasher) ;
277
- }
278
- }
279
- }
0 commit comments