@@ -651,8 +651,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
651
651
}
652
652
}
653
653
654
+ #[ instrument( level = "debug" , skip( self ) ) ]
654
655
fn assemble_probe ( & mut self , self_ty : & Canonical < ' tcx , QueryResponse < ' tcx , Ty < ' tcx > > > ) {
655
- debug ! ( "assemble_probe: self_ty={:?}" , self_ty) ;
656
656
let raw_self_ty = self_ty. value . value ;
657
657
match * raw_self_ty. kind ( ) {
658
658
ty:: Dynamic ( data, ..) if let Some ( p) = data. principal ( ) => {
@@ -730,13 +730,12 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
730
730
}
731
731
}
732
732
733
+ #[ instrument( level = "debug" , skip( self ) ) ]
733
734
fn assemble_inherent_impl_probe ( & mut self , impl_def_id : DefId ) {
734
735
if !self . impl_dups . insert ( impl_def_id) {
735
736
return ; // already visited
736
737
}
737
738
738
- debug ! ( "assemble_inherent_impl_probe {:?}" , impl_def_id) ;
739
-
740
739
for item in self . impl_or_trait_item ( impl_def_id) {
741
740
if !self . has_applicable_self ( & item) {
742
741
// No receiver declared. Not a candidate.
@@ -786,9 +785,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
786
785
}
787
786
}
788
787
788
+ #[ instrument( level = "debug" , skip( self ) ) ]
789
789
fn assemble_inherent_candidates_from_object ( & mut self , self_ty : Ty < ' tcx > ) {
790
- debug ! ( "assemble_inherent_candidates_from_object(self_ty={:?})" , self_ty) ;
791
-
792
790
let principal = match self_ty. kind ( ) {
793
791
ty:: Dynamic ( ref data, ..) => Some ( data) ,
794
792
_ => None ,
@@ -835,9 +833,9 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
835
833
} ) ;
836
834
}
837
835
836
+ #[ instrument( level = "debug" , skip( self ) ) ]
838
837
fn assemble_inherent_candidates_from_param ( & mut self , param_ty : ty:: ParamTy ) {
839
838
// FIXME: do we want to commit to this behavior for param bounds?
840
- debug ! ( "assemble_inherent_candidates_from_param(param_ty={:?})" , param_ty) ;
841
839
842
840
let bounds = self . param_env . caller_bounds ( ) . iter ( ) . filter_map ( |predicate| {
843
841
let bound_predicate = predicate. kind ( ) ;
@@ -904,6 +902,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
904
902
}
905
903
}
906
904
905
+ #[ instrument( level = "debug" , skip( self ) ) ]
907
906
fn assemble_extension_candidates_for_traits_in_scope ( & mut self ) {
908
907
let mut duplicates = FxHashSet :: default ( ) ;
909
908
let opt_applicable_traits = self . tcx . in_scope_traits ( self . scope_expr_id ) ;
@@ -920,6 +919,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
920
919
}
921
920
}
922
921
922
+ #[ instrument( level = "debug" , skip( self ) ) ]
923
923
fn assemble_extension_candidates_for_all_traits ( & mut self ) {
924
924
let mut duplicates = FxHashSet :: default ( ) ;
925
925
for trait_info in suggest:: all_traits ( self . tcx ) {
@@ -956,12 +956,12 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
956
956
}
957
957
}
958
958
959
+ #[ instrument( level = "debug" , skip( self ) ) ]
959
960
fn assemble_extension_candidates_for_trait (
960
961
& mut self ,
961
962
import_ids : & SmallVec < [ LocalDefId ; 1 ] > ,
962
963
trait_def_id : DefId ,
963
964
) {
964
- debug ! ( "assemble_extension_candidates_for_trait(trait_def_id={:?})" , trait_def_id) ;
965
965
let trait_args = self . fresh_args_for_item ( self . span , trait_def_id) ;
966
966
let trait_ref = ty:: TraitRef :: new ( self . tcx , trait_def_id, trait_args) ;
967
967
@@ -1066,6 +1066,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
1066
1066
///////////////////////////////////////////////////////////////////////////
1067
1067
// THE ACTUAL SEARCH
1068
1068
1069
+ #[ instrument( level = "debug" , skip( self ) ) ]
1069
1070
fn pick ( mut self ) -> PickResult < ' tcx > {
1070
1071
assert ! ( self . method_name. is_some( ) ) ;
1071
1072
@@ -1492,12 +1493,10 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
1492
1493
// Thus we need to prevent them from trying to match the `&_` autoref
1493
1494
// candidates that get created for `&self` trait methods.
1494
1495
ty:: Alias ( ty:: Opaque , alias_ty)
1495
- if self . infcx . can_define_opaque_ty ( alias_ty. def_id ) =>
1496
+ if self . infcx . can_define_opaque_ty ( alias_ty. def_id )
1497
+ && !probe. xform_self_ty . is_ty_var ( ) =>
1496
1498
{
1497
- if !probe. xform_self_ty . is_ty_var ( ) {
1498
- return ProbeResult :: NoMatch ;
1499
- }
1500
- vec ! [ ]
1499
+ return ProbeResult :: NoMatch ;
1501
1500
}
1502
1501
_ => match self . at ( & ObligationCause :: dummy ( ) , self . param_env ) . sup (
1503
1502
DefineOpaqueTypes :: Yes ,
@@ -1767,6 +1766,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
1767
1766
/// Similarly to `probe_for_return_type`, this method attempts to find the best matching
1768
1767
/// candidate method where the method name may have been misspelled. Similarly to other
1769
1768
/// edit distance based suggestions, we provide at most one such suggestion.
1769
+ #[ instrument( level = "debug" , skip( self ) ) ]
1770
1770
pub ( crate ) fn probe_for_similar_candidate (
1771
1771
& mut self ,
1772
1772
) -> Result < Option < ty:: AssocItem > , MethodError < ' tcx > > {
0 commit comments