Skip to content

Commit 0751997

Browse files
committed
Rename as_bound_var to assert_bound_var
1 parent af8196b commit 0751997

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/librustc/infer/canonical/query_response.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
448448

449449
// We only allow a `ty::INNERMOST` index in substitutions.
450450
assert_eq!(index, ty::INNERMOST);
451-
opt_values[br.as_bound_var()] = Some(*original_value);
451+
opt_values[br.assert_bound_var()] = Some(*original_value);
452452
}
453453
}
454454
}

src/librustc/infer/canonical/substitute.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ where
6767
value.clone()
6868
} else {
6969
let fld_r = |br: ty::BoundRegion| {
70-
match var_values.var_values[br.as_bound_var()].unpack() {
70+
match var_values.var_values[br.assert_bound_var()].unpack() {
7171
UnpackedKind::Lifetime(l) => l,
7272
r => bug!("{:?} is a region but value is {:?}", br, r),
7373
}

src/librustc/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl BoundRegion {
8282
/// regions with anonymous late bound regions. This method asserts that
8383
/// we have an anonymous late bound region, which hence may refer to
8484
/// a canonical variable.
85-
pub fn as_bound_var(&self) -> BoundVar {
85+
pub fn assert_bound_var(&self) -> BoundVar {
8686
match *self {
8787
BoundRegion::BrAnon(var) => BoundVar::from_u32(var),
8888
_ => bug!("bound region is not anonymous"),

src/librustc/ty/subst.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl CanonicalUserSubsts<'tcx> {
568568
ty::ReLateBound(index, br) => {
569569
// We only allow a `ty::INNERMOST` index in substitutions.
570570
assert_eq!(*index, ty::INNERMOST);
571-
cvar == br.as_bound_var()
571+
cvar == br.assert_bound_var()
572572
}
573573
_ => false,
574574
},

0 commit comments

Comments
 (0)