Skip to content

Commit

Permalink
Rename as_bound_var to assert_bound_var
Browse files Browse the repository at this point in the history
  • Loading branch information
scalexm committed Oct 25, 2018
1 parent 47499cc commit 2bf01aa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc/infer/canonical/query_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {

// We only allow a `ty::INNERMOST` index in substitutions.
assert_eq!(index, ty::INNERMOST);
opt_values[br.as_bound_var()] = Some(*original_value);
opt_values[br.assert_bound_var()] = Some(*original_value);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/canonical/substitute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ where
value.clone()
} else {
let fld_r = |br: ty::BoundRegion| {
match var_values.var_values[br.as_bound_var()].unpack() {
match var_values.var_values[br.assert_bound_var()].unpack() {
UnpackedKind::Lifetime(l) => l,
r => bug!("{:?} is a region but value is {:?}", br, r),
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl BoundRegion {
/// regions with anonymous late bound regions. This method asserts that
/// we have an anonymous late bound region, which hence may refer to
/// a canonical variable.
pub fn as_bound_var(&self) -> BoundVar {
pub fn assert_bound_var(&self) -> BoundVar {
match *self {
BoundRegion::BrAnon(var) => BoundVar::from_u32(var),
_ => bug!("bound region is not anonymous"),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/subst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ impl CanonicalUserSubsts<'tcx> {
ty::ReLateBound(index, br) => {
// We only allow a `ty::INNERMOST` index in substitutions.
assert_eq!(*index, ty::INNERMOST);
cvar == br.as_bound_var()
cvar == br.assert_bound_var()
}
_ => false,
},
Expand Down

0 comments on commit 2bf01aa

Please sign in to comment.