]> git.lizzy.rs Git - rust.git/commitdiff
rename functions
authorSNCPlay42 <SNCPlay42@gmail.com>
Wed, 22 Jul 2020 19:17:10 +0000 (20:17 +0100)
committerSNCPlay42 <SNCPlay42@gmail.com>
Wed, 22 Jul 2020 22:52:49 +0000 (23:52 +0100)
src/librustc_mir/borrow_check/diagnostics/region_name.rs

index 0f199de33089793046a87cce9ca299b93cde38ff..9e5851fd81165033861601362a919328efb4b1e3 100644 (file)
@@ -337,7 +337,7 @@ fn give_name_if_anonymous_region_appears_in_arguments(
         let arg_ty = self.regioncx.universal_regions().unnormalized_input_tys
             [implicit_inputs + argument_index];
         if let Some(highlight) =
-            self.give_name_if_we_can_match_hir_ty_from_argument(fr, arg_ty, argument_index)
+            self.highlight_if_we_can_match_hir_ty_from_argument(fr, arg_ty, argument_index)
         {
             return Some(RegionName {
                 name: self.synthesize_region_name(),
@@ -346,7 +346,7 @@ fn give_name_if_anonymous_region_appears_in_arguments(
         }
 
         let counter = *self.next_region_name.try_borrow().unwrap();
-        if let Some(highlight) = self.give_name_if_we_cannot_match_hir_ty(fr, arg_ty, counter) {
+        if let Some(highlight) = self.highlight_if_we_cannot_match_hir_ty(fr, arg_ty, counter) {
             Some(RegionName {
                 // This counter value will already have been used, so this function will increment
                 // it so the next value will be used next and return the region name that would
@@ -359,7 +359,7 @@ fn give_name_if_anonymous_region_appears_in_arguments(
         }
     }
 
-    fn give_name_if_we_can_match_hir_ty_from_argument(
+    fn highlight_if_we_can_match_hir_ty_from_argument(
         &self,
         needle_fr: RegionVid,
         argument_ty: Ty<'tcx>,
@@ -376,7 +376,7 @@ fn give_name_if_we_can_match_hir_ty_from_argument(
             // (`give_name_if_anonymous_region_appears_in_arguments`).
             hir::TyKind::Infer => None,
 
-            _ => self.give_name_if_we_can_match_hir_ty(needle_fr, argument_ty, argument_hir_ty),
+            _ => self.highlight_if_we_can_match_hir_ty(needle_fr, argument_ty, argument_hir_ty),
         }
     }
 
@@ -391,7 +391,7 @@ fn give_name_if_we_can_match_hir_ty_from_argument(
     ///  |          |  has type `&'1 u32`
     ///  |          has type `&'2 u32`
     /// ```
-    fn give_name_if_we_cannot_match_hir_ty(
+    fn highlight_if_we_cannot_match_hir_ty(
         &self,
         needle_fr: RegionVid,
         argument_ty: Ty<'tcx>,
@@ -402,7 +402,7 @@ fn give_name_if_we_cannot_match_hir_ty(
         let type_name = self.infcx.extract_type_name(&argument_ty, Some(highlight)).0;
 
         debug!(
-            "give_name_if_we_cannot_match_hir_ty: type_name={:?} needle_fr={:?}",
+            "highlight_if_we_cannot_match_hir_ty: type_name={:?} needle_fr={:?}",
             type_name, needle_fr
         );
         if type_name.find(&format!("'{}", counter)).is_some() {
@@ -442,7 +442,7 @@ fn give_name_if_we_cannot_match_hir_ty(
     /// keep track of the **closest** type we've found. If we fail to
     /// find the exact `&` or `'_` to highlight, then we may fall back
     /// to highlighting that closest type instead.
-    fn give_name_if_we_can_match_hir_ty(
+    fn highlight_if_we_can_match_hir_ty(
         &self,
         needle_fr: RegionVid,
         argument_ty: Ty<'tcx>,