about summary refs log tree commit diff
diff options
context:
space:
mode:
authorscalexm <alexandre@scalexm.fr>2018-10-23 16:28:53 +0200
committerscalexm <alexandre@scalexm.fr>2018-11-03 11:41:55 +0100
commitee569c796d093adfdf632e99978b6e8877716e68 (patch)
treeff71a48a7406417c44130820551f55029bc1209a
parent3dd303aa894e65219117b831f5c6284ec1077eae (diff)
downloadrust-ee569c796d093adfdf632e99978b6e8877716e68.tar.gz
rust-ee569c796d093adfdf632e99978b6e8877716e68.zip
Rename `BoundTy` field `level` -> `index`
-rw-r--r--src/librustc/ty/flags.rs2
-rw-r--r--src/librustc/ty/fold.rs4
-rw-r--r--src/librustc/ty/sty.rs8
-rw-r--r--src/librustc/util/ppaux.rs4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/librustc/ty/flags.rs b/src/librustc/ty/flags.rs
index d0ea7f653d1..6c1070f74e0 100644
--- a/src/librustc/ty/flags.rs
+++ b/src/librustc/ty/flags.rs
@@ -117,7 +117,7 @@ impl FlagComputation {
 
             &ty::Bound(bound_ty) => {
                 self.add_flags(TypeFlags::HAS_CANONICAL_VARS);
-                self.add_binder(bound_ty.level);
+                self.add_binder(bound_ty.index);
             }
 
             &ty::Infer(infer) => {
diff --git a/src/librustc/ty/fold.rs b/src/librustc/ty/fold.rs
index cb94d7d1083..87ff5d2a36d 100644
--- a/src/librustc/ty/fold.rs
+++ b/src/librustc/ty/fold.rs
@@ -655,11 +655,11 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Shifter<'a, 'gcx, 'tcx> {
     fn fold_ty(&mut self, ty: ty::Ty<'tcx>) -> ty::Ty<'tcx> {
         match ty.sty {
             ty::Bound(bound_ty) => {
-                if self.amount == 0 || bound_ty.level < self.current_index {
+                if self.amount == 0 || bound_ty.index < self.current_index {
                     ty
                 } else {
                     let shifted = ty::BoundTy {
-                        level: bound_ty.level.shifted_in(self.amount),
+                        index: bound_ty.index.shifted_in(self.amount),
                         var: bound_ty.var,
                         kind: bound_ty.kind,
                     };
diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs
index 1890006b514..9c20d9a238e 100644
--- a/src/librustc/ty/sty.rs
+++ b/src/librustc/ty/sty.rs
@@ -1230,7 +1230,7 @@ newtype_index! {
 
 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
 pub struct BoundTy {
-    pub level: DebruijnIndex,
+    pub index: DebruijnIndex,
     pub var: BoundVar,
     pub kind: BoundTyKind,
 }
@@ -1241,13 +1241,13 @@ pub enum BoundTyKind {
     Param(InternedString),
 }
 
-impl_stable_hash_for!(struct BoundTy { level, var, kind });
+impl_stable_hash_for!(struct BoundTy { index, var, kind });
 impl_stable_hash_for!(enum self::BoundTyKind { Anon, Param(a) });
 
 impl BoundTy {
-    pub fn new(level: DebruijnIndex, var: BoundVar) -> Self {
+    pub fn new(index: DebruijnIndex, var: BoundVar) -> Self {
         BoundTy {
-            level,
+            index,
             var,
             kind: BoundTyKind::Anon,
         }
diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs
index 320fee5638e..222bbc67b0d 100644
--- a/src/librustc/util/ppaux.rs
+++ b/src/librustc/util/ppaux.rs
@@ -1120,10 +1120,10 @@ define_print! {
                 Bound(bound_ty) => {
                     match bound_ty.kind {
                         ty::BoundTyKind::Anon => {
-                            if bound_ty.level == ty::INNERMOST {
+                            if bound_ty.index == ty::INNERMOST {
                                 write!(f, "?{}", bound_ty.var.index())
                             } else {
-                                write!(f, "?{}_{}", bound_ty.level.index(), bound_ty.var.index())
+                                write!(f, "?{}_{}", bound_ty.index.index(), bound_ty.var.index())
                             }
                         }