Skip to content

Commit 9049c85

Browse files
committed
Rename BoundTy field level -> index
1 parent ab820ad commit 9049c85

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/librustc/ty/flags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl FlagComputation {
117117

118118
&ty::Bound(bound_ty) => {
119119
self.add_flags(TypeFlags::HAS_CANONICAL_VARS);
120-
self.add_binder(bound_ty.level);
120+
self.add_binder(bound_ty.index);
121121
}
122122

123123
&ty::Infer(infer) => {

src/librustc/ty/fold.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,11 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Shifter<'a, 'gcx, 'tcx> {
655655
fn fold_ty(&mut self, ty: ty::Ty<'tcx>) -> ty::Ty<'tcx> {
656656
match ty.sty {
657657
ty::Bound(bound_ty) => {
658-
if self.amount == 0 || bound_ty.level < self.current_index {
658+
if self.amount == 0 || bound_ty.index < self.current_index {
659659
ty
660660
} else {
661661
let shifted = ty::BoundTy {
662-
level: bound_ty.level.shifted_in(self.amount),
662+
index: bound_ty.index.shifted_in(self.amount),
663663
var: bound_ty.var,
664664
kind: bound_ty.kind,
665665
};

src/librustc/ty/sty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ newtype_index! {
12301230

12311231
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
12321232
pub struct BoundTy {
1233-
pub level: DebruijnIndex,
1233+
pub index: DebruijnIndex,
12341234
pub var: BoundVar,
12351235
pub kind: BoundTyKind,
12361236
}
@@ -1241,13 +1241,13 @@ pub enum BoundTyKind {
12411241
Param(InternedString),
12421242
}
12431243

1244-
impl_stable_hash_for!(struct BoundTy { level, var, kind });
1244+
impl_stable_hash_for!(struct BoundTy { index, var, kind });
12451245
impl_stable_hash_for!(enum self::BoundTyKind { Anon, Param(a) });
12461246

12471247
impl BoundTy {
1248-
pub fn new(level: DebruijnIndex, var: BoundVar) -> Self {
1248+
pub fn new(index: DebruijnIndex, var: BoundVar) -> Self {
12491249
BoundTy {
1250-
level,
1250+
index,
12511251
var,
12521252
kind: BoundTyKind::Anon,
12531253
}

src/librustc/util/ppaux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,10 +1128,10 @@ define_print! {
11281128
Bound(bound_ty) => {
11291129
match bound_ty.kind {
11301130
ty::BoundTyKind::Anon => {
1131-
if bound_ty.level == ty::INNERMOST {
1131+
if bound_ty.index == ty::INNERMOST {
11321132
write!(f, "?{}", bound_ty.var.index())
11331133
} else {
1134-
write!(f, "?{}_{}", bound_ty.level.index(), bound_ty.var.index())
1134+
write!(f, "?{}_{}", bound_ty.index.index(), bound_ty.var.index())
11351135
}
11361136
}
11371137

0 commit comments

Comments
 (0)