File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2630,14 +2630,14 @@ impl ClashingExternDeclarations {
2630
2630
let local_did = tcx. hir ( ) . local_def_id ( fi. hir_id ) ;
2631
2631
let did = local_did. to_def_id ( ) ;
2632
2632
let instance = Instance :: new ( did, ty:: List :: identity_for_item ( tcx, did) ) ;
2633
- let name = tcx. symbol_name ( instance) . name . to_string ( ) ;
2634
- if self . seen_decls . contains_key ( & name) {
2633
+ let name = tcx. symbol_name ( instance) . name ;
2634
+ if let Some ( & hir_id ) = self . seen_decls . get ( name) {
2635
2635
// Avoid updating the map with the new entry when we do find a collision. We want to
2636
2636
// make sure we're always pointing to the first definition as the previous declaration.
2637
2637
// This lets us avoid emitting "knock-on" diagnostics.
2638
- Some ( * self . seen_decls . get ( & name ) . unwrap ( ) )
2638
+ Some ( hir_id )
2639
2639
} else {
2640
- self . seen_decls . insert ( name, hid)
2640
+ self . seen_decls . insert ( name. to_owned ( ) , hid)
2641
2641
}
2642
2642
}
2643
2643
You can’t perform that action at this time.
0 commit comments