@@ -2864,13 +2864,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2864
2864
( expr_t, "" )
2865
2865
} ;
2866
2866
for ( found_fields, args) in
2867
- self . get_field_candidates_considering_privacy ( span, ty, mod_id, id)
2867
+ self . get_field_candidates_considering_privacy_for_diag ( span, ty, mod_id, id)
2868
2868
{
2869
2869
let field_names = found_fields. iter ( ) . map ( |field| field. name ) . collect :: < Vec < _ > > ( ) ;
2870
2870
let mut candidate_fields: Vec < _ > = found_fields
2871
2871
. into_iter ( )
2872
2872
. filter_map ( |candidate_field| {
2873
- self . check_for_nested_field_satisfying (
2873
+ self . check_for_nested_field_satisfying_condition_for_diag (
2874
2874
span,
2875
2875
& |candidate_field, _| candidate_field. ident ( self . tcx ( ) ) == field,
2876
2876
candidate_field,
@@ -2933,7 +2933,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2933
2933
. with_span_label ( field. span , "private field" )
2934
2934
}
2935
2935
2936
- pub ( crate ) fn get_field_candidates_considering_privacy (
2936
+ pub ( crate ) fn get_field_candidates_considering_privacy_for_diag (
2937
2937
& self ,
2938
2938
span : Span ,
2939
2939
base_ty : Ty < ' tcx > ,
@@ -2986,7 +2986,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2986
2986
2987
2987
/// This method is called after we have encountered a missing field error to recursively
2988
2988
/// search for the field
2989
- pub ( crate ) fn check_for_nested_field_satisfying (
2989
+ pub ( crate ) fn check_for_nested_field_satisfying_condition_for_diag (
2990
2990
& self ,
2991
2991
span : Span ,
2992
2992
matches : & impl Fn ( & ty:: FieldDef , Ty < ' tcx > ) -> bool ,
@@ -3011,20 +3011,24 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3011
3011
if matches ( candidate_field, field_ty) {
3012
3012
return Some ( field_path) ;
3013
3013
} else {
3014
- for ( nested_fields, subst) in
3015
- self . get_field_candidates_considering_privacy ( span, field_ty, mod_id, hir_id)
3014
+ for ( nested_fields, subst) in self
3015
+ . get_field_candidates_considering_privacy_for_diag (
3016
+ span, field_ty, mod_id, hir_id,
3017
+ )
3016
3018
{
3017
3019
// recursively search fields of `candidate_field` if it's a ty::Adt
3018
3020
for field in nested_fields {
3019
- if let Some ( field_path) = self . check_for_nested_field_satisfying (
3020
- span,
3021
- matches,
3022
- field,
3023
- subst,
3024
- field_path. clone ( ) ,
3025
- mod_id,
3026
- hir_id,
3027
- ) {
3021
+ if let Some ( field_path) = self
3022
+ . check_for_nested_field_satisfying_condition_for_diag (
3023
+ span,
3024
+ matches,
3025
+ field,
3026
+ subst,
3027
+ field_path. clone ( ) ,
3028
+ mod_id,
3029
+ hir_id,
3030
+ )
3031
+ {
3028
3032
return Some ( field_path) ;
3029
3033
}
3030
3034
}
0 commit comments