@@ -67,7 +67,6 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
6767 // them explicitly here.
6868 ref attrs,
6969 span,
70-
7170 // These fields are handled separately:
7271 exported_macros : _,
7372 items : _,
@@ -128,30 +127,27 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
128127 cstore : & dyn CrateStore ,
129128 source_map : & SourceMap ,
130129 commandline_args_hash : u64 )
131- -> ( Vec < Option < Entry < ' hir > > > , Svh ) {
132- self . hir_body_nodes
133- . sort_unstable_by ( | & ( ref d1 , _ ) , & ( ref d2 , _ ) | d1 . cmp ( d2 ) ) ;
130+ -> ( Vec < Option < Entry < ' hir > > > , Svh )
131+ {
132+ self . hir_body_nodes . sort_unstable_by_key ( |bn| bn . 0 ) ;
134133
135134 let node_hashes = self
136135 . hir_body_nodes
137136 . iter ( )
138- . fold ( Fingerprint :: ZERO , |fingerprint , & ( def_path_hash, dep_node_index) | {
137+ . fold ( Fingerprint :: ZERO , |fingerprint, & ( def_path_hash, dep_node_index) | {
139138 fingerprint. combine (
140139 def_path_hash. 0 . combine ( self . dep_graph . fingerprint_of ( dep_node_index) )
141140 )
142141 } ) ;
143142
144143 let mut upstream_crates: Vec < _ > = cstore. crates_untracked ( ) . iter ( ) . map ( |& cnum| {
145144 let name = cstore. crate_name_untracked ( cnum) . as_str ( ) ;
146- let disambiguator = cstore. crate_disambiguator_untracked ( cnum)
147- . to_fingerprint ( ) ;
145+ let disambiguator = cstore. crate_disambiguator_untracked ( cnum) . to_fingerprint ( ) ;
148146 let hash = cstore. crate_hash_untracked ( cnum) ;
149147 ( name, disambiguator, hash)
150148 } ) . collect ( ) ;
151149
152- upstream_crates. sort_unstable_by ( |& ( name1, dis1, _) , & ( name2, dis2, _) | {
153- ( name1, dis1) . cmp ( & ( name2, dis2) )
154- } ) ;
150+ upstream_crates. sort_unstable_by_key ( |& ( name, dis, _) | ( name, dis) ) ;
155151
156152 // We hash the final, remapped names of all local source files so we
157153 // don't have to include the path prefix remapping commandline args.
@@ -229,7 +225,6 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
229225 }
230226
231227 self . insert_entry ( id, entry) ;
232-
233228 }
234229
235230 fn with_parent < F : FnOnce ( & mut Self ) > ( & mut self , parent_id : NodeId , f : F ) {
@@ -311,14 +306,11 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
311306 self . with_dep_node_owner ( i. hir_id . owner , i, |this| {
312307 this. insert ( i. id , Node :: Item ( i) ) ;
313308 this. with_parent ( i. id , |this| {
314- match i. node {
315- ItemKind :: Struct ( ref struct_def, _) => {
316- // If this is a tuple-like struct, register the constructor.
317- if !struct_def. is_struct ( ) {
318- this. insert ( struct_def. id ( ) , Node :: StructCtor ( struct_def) ) ;
319- }
309+ if let ItemKind :: Struct ( ref struct_def, _) = i. node {
310+ // If this is a tuple-like struct, register the constructor.
311+ if !struct_def. is_struct ( ) {
312+ this. insert ( struct_def. id ( ) , Node :: StructCtor ( struct_def) ) ;
320313 }
321- _ => { }
322314 }
323315 intravisit:: walk_item ( this, i) ;
324316 } ) ;
0 commit comments