about summary refs log tree commit diff
path: root/src/librustc/middle/mem_categorization.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-06-21 14:32:34 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2018-07-03 15:02:35 -0600
commit77e7352bbe64e7142a41cff1ca7a8bbff3e215bb (patch)
tree0436fe3d61e49ca0603ee60e4b58f0e574c92716 /src/librustc/middle/mem_categorization.rs
parent3eda71b00ad48d7bf4eef4c443e7f611fd061418 (diff)
downloadrust-77e7352bbe64e7142a41cff1ca7a8bbff3e215bb.tar.gz
rust-77e7352bbe64e7142a41cff1ca7a8bbff3e215bb.zip
rename `pat_ty` to `pat_ty_adjusted` for clarity
Diffstat (limited to 'src/librustc/middle/mem_categorization.rs')
-rw-r--r--src/librustc/middle/mem_categorization.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs
index 4688f6708d3..b717986dce9 100644
--- a/src/librustc/middle/mem_categorization.rs
+++ b/src/librustc/middle/mem_categorization.rs
@@ -517,7 +517,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
     ///   implicit deref patterns attached (e.g., it is really
     ///   `&Some(x)`). In that case, we return the "outermost" type
     ///   (e.g., `&Option<T>).
-    fn pat_ty(&self, pat: &hir::Pat) -> McResult<Ty<'tcx>> {
+    fn pat_ty_adjusted(&self, pat: &hir::Pat) -> McResult<Ty<'tcx>> {
         // Check for implicit `&` types wrapping the pattern; note
         // that these are never attached to binding patterns, so
         // actually this is somewhat "disjoint" from the code below
@@ -1283,7 +1283,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
             };
 
             for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) {
-                let subpat_ty = self.pat_ty(&subpat)?; // see (*2)
+                let subpat_ty = self.pat_ty_adjusted(&subpat)?; // see (*2)
                 let interior = InteriorField(FieldIndex(i, Name::intern(&i.to_string())));
                 let subcmt = Rc::new(self.cat_imm_interior(pat, cmt.clone(), subpat_ty, interior));
                 self.cat_pattern_(subcmt, &subpat, op)?;
@@ -1306,7 +1306,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
             };
 
             for fp in field_pats {
-                let field_ty = self.pat_ty(&fp.node.pat)?; // see (*2)
+                let field_ty = self.pat_ty_adjusted(&fp.node.pat)?; // see (*2)
                 let f_index = self.tcx.field_index(fp.node.id, self.tables);
                 let cmt_field =
                     Rc::new(self.cat_field(pat, cmt.clone(), f_index, fp.node.name, field_ty));
@@ -1325,7 +1325,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
                 ref ty => span_bug!(pat.span, "tuple pattern unexpected type {:?}", ty),
             };
             for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) {
-                let subpat_ty = self.pat_ty(&subpat)?; // see (*2)
+                let subpat_ty = self.pat_ty_unadjusted(&subpat)?; // see (*2)
                 let interior = InteriorField(FieldIndex(i, Name::intern(&i.to_string())));
                 let subcmt = Rc::new(self.cat_imm_interior(pat, cmt.clone(), subpat_ty, interior));
                 self.cat_pattern_(subcmt, &subpat, op)?;