@@ -827,27 +827,33 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
827
827
) else {
828
828
return ;
829
829
} ;
830
- let in_scope_methods = self . probe_for_name_many (
831
- probe:: Mode :: MethodCall ,
832
- path. ident ,
833
- Some ( expected) ,
834
- probe:: IsSuggestion ( true ) ,
835
- self_ty,
836
- deref. hir_id ,
837
- probe:: ProbeScope :: TraitsInScope ,
838
- ) ;
830
+ let in_scope_methods = self
831
+ . probe_for_name_many (
832
+ probe:: Mode :: MethodCall ,
833
+ path. ident ,
834
+ Some ( expected) ,
835
+ probe:: IsSuggestion ( true ) ,
836
+ self_ty,
837
+ deref. hir_id ,
838
+ probe:: ProbeScope :: TraitsInScope ,
839
+ )
840
+ . unwrap_or ( Vec :: new ( ) ) ;
841
+
839
842
let other_methods_in_scope: Vec < _ > =
840
843
in_scope_methods. iter ( ) . filter ( |c| c. item . def_id != pick. item . def_id ) . collect ( ) ;
841
844
842
- let all_methods = self . probe_for_name_many (
843
- probe:: Mode :: MethodCall ,
844
- path. ident ,
845
- Some ( expected) ,
846
- probe:: IsSuggestion ( true ) ,
847
- self_ty,
848
- deref. hir_id ,
849
- probe:: ProbeScope :: AllTraits ,
850
- ) ;
845
+ let all_methods = self
846
+ . probe_for_name_many (
847
+ probe:: Mode :: MethodCall ,
848
+ path. ident ,
849
+ Some ( expected) ,
850
+ probe:: IsSuggestion ( true ) ,
851
+ self_ty,
852
+ deref. hir_id ,
853
+ probe:: ProbeScope :: AllTraits ,
854
+ )
855
+ . unwrap_or ( Vec :: new ( ) ) ;
856
+
851
857
let suggestions: Vec < _ > = all_methods
852
858
. into_iter ( )
853
859
. filter ( |c| c. item . def_id != pick. item . def_id )
0 commit comments