@@ -2864,13 +2864,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
28642864 ( expr_t, "" )
28652865 } ;
28662866 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)
28682868 {
28692869 let field_names = found_fields. iter ( ) . map ( |field| field. name ) . collect :: < Vec < _ > > ( ) ;
28702870 let mut candidate_fields: Vec < _ > = found_fields
28712871 . into_iter ( )
28722872 . filter_map ( |candidate_field| {
2873- self . check_for_nested_field_satisfying (
2873+ self . check_for_nested_field_satisfying_condition_for_diag (
28742874 span,
28752875 & |candidate_field, _| candidate_field. ident ( self . tcx ( ) ) == field,
28762876 candidate_field,
@@ -2933,7 +2933,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
29332933 . with_span_label ( field. span , "private field" )
29342934 }
29352935
2936- pub ( crate ) fn get_field_candidates_considering_privacy (
2936+ pub ( crate ) fn get_field_candidates_considering_privacy_for_diag (
29372937 & self ,
29382938 span : Span ,
29392939 base_ty : Ty < ' tcx > ,
@@ -2986,7 +2986,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
29862986
29872987 /// This method is called after we have encountered a missing field error to recursively
29882988 /// 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 (
29902990 & self ,
29912991 span : Span ,
29922992 matches : & impl Fn ( & ty:: FieldDef , Ty < ' tcx > ) -> bool ,
@@ -3011,20 +3011,24 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
30113011 if matches ( candidate_field, field_ty) {
30123012 return Some ( field_path) ;
30133013 } 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+ )
30163018 {
30173019 // recursively search fields of `candidate_field` if it's a ty::Adt
30183020 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+ {
30283032 return Some ( field_path) ;
30293033 }
30303034 }
0 commit comments