@@ -169,7 +169,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
169
169
current_item : & Option < String > ,
170
170
parent_id : Option < DefId > ,
171
171
extra_fragment : & Option < String > ,
172
- item_opt : Option < & Item > ,
172
+ item : & Item ,
173
173
) -> Result < ( Res , Option < String > ) , ErrorKind > {
174
174
let cx = self . cx ;
175
175
@@ -333,8 +333,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
333
333
// TODO: give a warning if this is ambiguous
334
334
. next ( ) ;
335
335
// TODO: is this necessary? It doesn't look right, and also only works for local items
336
- let trait_kind = item_opt
337
- . and_then ( |item| self . cx . as_local_hir_id ( item. def_id ) )
336
+ let trait_kind = self . cx . as_local_hir_id ( item. def_id )
338
337
. and_then ( |item_hir| {
339
338
// Checks if item_name belongs to `impl SomeTrait for SomeItem`
340
339
let parent_hir = self . cx . tcx . hir ( ) . get_parent_item ( item_hir) ;
@@ -703,7 +702,7 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
703
702
& current_item,
704
703
base_node,
705
704
& extra_fragment,
706
- Some ( & item) ,
705
+ & item,
707
706
) {
708
707
Ok ( res) => res,
709
708
Err ( ErrorKind :: ResolutionFailure ) => {
@@ -727,7 +726,7 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
727
726
& current_item,
728
727
base_node,
729
728
& extra_fragment,
730
- Some ( & item) ,
729
+ & item,
731
730
) {
732
731
Ok ( res) => res,
733
732
Err ( ErrorKind :: ResolutionFailure ) => {
@@ -754,7 +753,7 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
754
753
& current_item,
755
754
base_node,
756
755
& extra_fragment,
757
- Some ( & item) ,
756
+ & item,
758
757
) {
759
758
Err ( ErrorKind :: AnchorFailure ( msg) ) => {
760
759
anchor_failure ( cx, & item, & ori_link, & dox, link_range, msg) ;
@@ -769,7 +768,7 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
769
768
& current_item,
770
769
base_node,
771
770
& extra_fragment,
772
- Some ( & item) ,
771
+ & item,
773
772
) {
774
773
Err ( ErrorKind :: AnchorFailure ( msg) ) => {
775
774
anchor_failure ( cx, & item, & ori_link, & dox, link_range, msg) ;
0 commit comments