@@ -1645,7 +1645,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16451645 }
16461646 } )
16471647 } ) ;
1648-
16491648 let fallback_param_to_point_at = predicate_substs. types ( ) . find_map ( |ty| {
16501649 ty. walk ( ) . find_map ( |arg| {
16511650 if let ty:: GenericArgKind :: Type ( ty) = arg. unpack ( )
@@ -1660,8 +1659,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16601659 } ) ;
16611660
16621661 let hir = self . tcx . hir ( ) ;
1662+
16631663 match hir. get ( hir_id) {
1664- hir:: Node :: Expr ( hir:: Expr { kind : hir:: ExprKind :: Path ( hir :: QPath :: Resolved ( _ , path ) ) , hir_id, .. } ) => {
1664+ hir:: Node :: Expr ( hir:: Expr { kind : hir:: ExprKind :: Path ( qpath ) , hir_id, .. } ) => {
16651665 if let hir:: Node :: Expr ( hir:: Expr { kind : hir:: ExprKind :: Call ( callee, args) , hir_id : call_hir_id, .. } )
16661666 = hir. get ( hir. get_parent_node ( * hir_id) )
16671667 && callee. hir_id == * hir_id
@@ -1677,12 +1677,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16771677 return ;
16781678 }
16791679
1680- if let Some ( param_to_point_at) = param_to_point_at
1680+ if let hir:: QPath :: Resolved ( _, path) = qpath
1681+ && let Some ( param_to_point_at) = param_to_point_at
16811682 && let Some ( segment) = path. segments . last ( )
16821683 && self . point_at_generics_if_possible ( error, def_id, param_to_point_at, segment)
16831684 {
16841685 return ;
16851686 }
1687+
1688+ if let hir:: QPath :: TypeRelative ( _, segment) = qpath
1689+ && let Some ( param_to_point_at) = param_to_point_at
1690+ && self . point_at_generics_if_possible ( error, def_id, param_to_point_at, segment)
1691+ {
1692+ return ;
1693+ }
16861694 }
16871695 }
16881696 hir:: Node :: Expr ( hir:: Expr { kind : hir:: ExprKind :: MethodCall ( segment, args, ..) , .. } ) => {
@@ -1727,6 +1735,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17271735 . enumerate ( )
17281736 . filter ( |( _, ty) | ty. walk ( ) . any ( |arg| arg == param_to_point_at) )
17291737 . collect ( ) ;
1738+
17301739 if let [ ( idx, _) ] = args_referencing_param. as_slice ( )
17311740 && let Some ( arg) = args. get ( * idx)
17321741 {
0 commit comments