@@ -777,7 +777,9 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
777
777
778
778
self . assemble_inherent_candidates_from_object ( generalized_self_ty) ;
779
779
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
+ {
781
783
self . assemble_inherent_candidates_for_incoherent_ty (
782
784
raw_self_ty,
783
785
receiver_steps,
@@ -787,7 +789,9 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
787
789
ty:: Adt ( def, _) => {
788
790
let def_id = def. did ( ) ;
789
791
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
+ {
791
795
self . assemble_inherent_candidates_for_incoherent_ty (
792
796
raw_self_ty,
793
797
receiver_steps,
@@ -796,7 +800,9 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
796
800
}
797
801
ty:: Foreign ( did) => {
798
802
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
+ {
800
806
self . assemble_inherent_candidates_for_incoherent_ty (
801
807
raw_self_ty,
802
808
receiver_steps,
@@ -2373,17 +2379,14 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
2373
2379
if !self . is_relevant_kind_for_mode ( x. kind ) {
2374
2380
return false ;
2375
2381
}
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 (
2380
2383
name. as_str ( ) ,
2381
2384
x. name ( ) . as_str ( ) ,
2382
2385
max_dist,
2383
2386
) {
2384
- Some ( d) => d > 0 ,
2385
- None => false ,
2387
+ return d > 0 ;
2386
2388
}
2389
+ self . matches_by_doc_alias ( x. def_id )
2387
2390
} )
2388
2391
. copied ( )
2389
2392
. collect ( )
0 commit comments