@@ -777,7 +777,9 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
777777
778778 self . assemble_inherent_candidates_from_object ( generalized_self_ty) ;
779779 self . assemble_inherent_impl_candidates_for_type ( p. def_id ( ) , receiver_steps) ;
780- if self . tcx . has_attr ( p. def_id ( ) , sym:: rustc_has_incoherent_inherent_impls) {
780+ if self . has_rustc_attrs
781+ && self . tcx . has_attr ( p. def_id ( ) , sym:: rustc_has_incoherent_inherent_impls)
782+ {
781783 self . assemble_inherent_candidates_for_incoherent_ty (
782784 raw_self_ty,
783785 receiver_steps,
@@ -787,7 +789,9 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
787789 ty:: Adt ( def, _) => {
788790 let def_id = def. did ( ) ;
789791 self . assemble_inherent_impl_candidates_for_type ( def_id, receiver_steps) ;
790- if self . tcx . has_attr ( def_id, sym:: rustc_has_incoherent_inherent_impls) {
792+ if self . has_rustc_attrs
793+ && self . tcx . has_attr ( def_id, sym:: rustc_has_incoherent_inherent_impls)
794+ {
791795 self . assemble_inherent_candidates_for_incoherent_ty (
792796 raw_self_ty,
793797 receiver_steps,
@@ -796,7 +800,9 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
796800 }
797801 ty:: Foreign ( did) => {
798802 self . assemble_inherent_impl_candidates_for_type ( did, receiver_steps) ;
799- if self . tcx . has_attr ( did, sym:: rustc_has_incoherent_inherent_impls) {
803+ if self . has_rustc_attrs
804+ && self . tcx . has_attr ( did, sym:: rustc_has_incoherent_inherent_impls)
805+ {
800806 self . assemble_inherent_candidates_for_incoherent_ty (
801807 raw_self_ty,
802808 receiver_steps,
@@ -2373,17 +2379,14 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
23732379 if !self . is_relevant_kind_for_mode ( x. kind ) {
23742380 return false ;
23752381 }
2376- if self . matches_by_doc_alias ( x. def_id ) {
2377- return true ;
2378- }
2379- match edit_distance_with_substrings (
2382+ if let Some ( d) = edit_distance_with_substrings (
23802383 name. as_str ( ) ,
23812384 x. name ( ) . as_str ( ) ,
23822385 max_dist,
23832386 ) {
2384- Some ( d) => d > 0 ,
2385- None => false ,
2387+ return d > 0 ;
23862388 }
2389+ self . matches_by_doc_alias ( x. def_id )
23872390 } )
23882391 . copied ( )
23892392 . collect ( )
0 commit comments