Skip to content

Commit d99195a

Browse files
committed
Rename Binder::no_late_bound_regions to Binder::no_bound_vars
1 parent 45be1ac commit d99195a

File tree

18 files changed

+34
-32
lines changed

18 files changed

+34
-32
lines changed

src/librustc/infer/outlives/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ impl<'cx, 'gcx, 'tcx> VerifyBoundCx<'cx, 'gcx, 'tcx> {
323323
predicates
324324
.into_iter()
325325
.filter_map(|p| p.as_ref().to_opt_type_outlives())
326-
.filter_map(|p| p.no_late_bound_regions())
326+
.filter_map(|p| p.no_bound_vars())
327327
.filter(move |p| compare_ty(p.0))
328328
}
329329
}

src/librustc/traits/auto_trait.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
683683
}
684684
&ty::Predicate::TypeOutlives(ref binder) => {
685685
match (
686-
binder.no_late_bound_regions(),
687-
binder.map_bound_ref(|pred| pred.0).no_late_bound_regions(),
686+
binder.no_bound_vars(),
687+
binder.map_bound_ref(|pred| pred.0).no_bound_vars(),
688688
) {
689689
(None, Some(t_a)) => {
690690
select.infcx().register_region_obligation_with_cause(

src/librustc/traits/fulfill.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,15 @@ impl<'a, 'b, 'gcx, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'gcx,
349349
}
350350

351351
ty::Predicate::TypeOutlives(ref binder) => {
352-
// Check if there are higher-ranked regions.
353-
match binder.no_late_bound_regions() {
352+
// Check if there are higher-ranked vars.
353+
match binder.no_bound_vars() {
354354
// If there are, inspect the underlying type further.
355355
None => {
356356
// Convert from `Binder<OutlivesPredicate<Ty, Region>>` to `Binder<Ty>`.
357357
let binder = binder.map_bound_ref(|pred| pred.0);
358358

359-
// Check if the type has any bound regions.
360-
match binder.no_late_bound_regions() {
359+
// Check if the type has any bound vars.
360+
match binder.no_bound_vars() {
361361
// If so, this obligation is an error (for now). Eventually we should be
362362
// able to support additional cases here, like `for<'a> &'a str: 'a`.
363363
// NOTE: this is duplicate-implemented between here and fulfillment.

src/librustc/traits/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ impl<'tcx> GoalKind<'tcx> {
352352
domain_goal: PolyDomainGoal<'tcx>,
353353
tcx: TyCtxt<'a, 'tcx, 'tcx>,
354354
) -> GoalKind<'tcx> {
355-
match domain_goal.no_late_bound_regions() {
355+
match domain_goal.no_bound_vars() {
356356
Some(p) => p.into_goal(),
357357
None => GoalKind::Quantified(
358358
QuantifierKind::Universal,

src/librustc/traits/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ impl<'cx, 'gcx, 'tcx> ProjectionCacheKey<'tcx> {
16191619
let infcx = selcx.infcx();
16201620
// We don't do cross-snapshot caching of obligations with escaping regions,
16211621
// so there's no cache key to use
1622-
predicate.no_late_bound_regions()
1622+
predicate.no_bound_vars()
16231623
.map(|predicate| ProjectionCacheKey {
16241624
// We don't attempt to match up with a specific type-variable state
16251625
// from a specific call to `opt_normalize_projection_type` - if

src/librustc/traits/query/outlives_bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub fn explicit_outlives_bounds<'tcx>(
164164
ty::Predicate::ClosureKind(..) |
165165
ty::Predicate::TypeOutlives(..) |
166166
ty::Predicate::ConstEvaluatable(..) => None,
167-
ty::Predicate::RegionOutlives(ref data) => data.no_late_bound_regions().map(
167+
ty::Predicate::RegionOutlives(ref data) => data.no_bound_vars().map(
168168
|ty::OutlivesPredicate(r_a, r_b)| OutlivesBound::RegionSubRegion(r_b, r_a),
169169
),
170170
})

src/librustc/traits/select.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
21682168
// T: Trait
21692169
// so it seems ok if we (conservatively) fail to accept that `Unsize`
21702170
// obligation above. Should be possible to extend this in the future.
2171-
let source = match obligation.self_ty().no_late_bound_regions() {
2171+
let source = match obligation.self_ty().no_bound_vars() {
21722172
Some(t) => t,
21732173
None => {
21742174
// Don't add any candidates if there are bound regions.
@@ -3235,7 +3235,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
32353235
// assemble_candidates_for_unsizing should ensure there are no late bound
32363236
// regions here. See the comment there for more details.
32373237
let source = self.infcx
3238-
.shallow_resolve(obligation.self_ty().no_late_bound_regions().unwrap());
3238+
.shallow_resolve(obligation.self_ty().no_bound_vars().unwrap());
32393239
let target = obligation
32403240
.predicate
32413241
.skip_binder()

src/librustc/ty/sty.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,10 @@ impl<T> Binder<T> {
799799
/// Skips the binder and returns the "bound" value. This is a
800800
/// risky thing to do because it's easy to get confused about
801801
/// debruijn indices and the like. It is usually better to
802-
/// discharge the binder using `no_late_bound_regions` or
802+
/// discharge the binder using `no_bound_vars` or
803803
/// `replace_late_bound_regions` or something like
804804
/// that. `skip_binder` is only valid when you are either
805-
/// extracting data that has nothing to do with bound regions, you
805+
/// extracting data that has nothing to do with bound vars, you
806806
/// are doing some sort of test that does not involve bound
807807
/// regions, or you are being very careful about your depth
808808
/// accounting.
@@ -811,7 +811,7 @@ impl<T> Binder<T> {
811811
///
812812
/// - extracting the def-id from a PolyTraitRef;
813813
/// - comparing the self type of a PolyTraitRef to see if it is equal to
814-
/// a type parameter `X`, since the type `X` does not reference any regions
814+
/// a type parameter `X`, since the type `X` does not reference any regions
815815
pub fn skip_binder(&self) -> &T {
816816
&self.0
817817
}
@@ -833,17 +833,17 @@ impl<T> Binder<T> {
833833
}
834834

835835
/// Unwraps and returns the value within, but only if it contains
836-
/// no bound regions at all. (In other words, if this binder --
836+
/// no bound vars at all. (In other words, if this binder --
837837
/// and indeed any enclosing binder -- doesn't bind anything at
838838
/// all.) Otherwise, returns `None`.
839839
///
840840
/// (One could imagine having a method that just unwraps a single
841-
/// binder, but permits late-bound regions bound by enclosing
841+
/// binder, but permits late-bound vars bound by enclosing
842842
/// binders, but that would require adjusting the debruijn
843843
/// indices, and given the shallow binding structure we often use,
844844
/// would not be that useful.)
845-
pub fn no_late_bound_regions<'tcx>(self) -> Option<T>
846-
where T : TypeFoldable<'tcx>
845+
pub fn no_bound_vars<'tcx>(self) -> Option<T>
846+
where T: TypeFoldable<'tcx>
847847
{
848848
if self.skip_binder().has_escaping_bound_vars() {
849849
None

src/librustc_codegen_llvm/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ fn maybe_create_entry_wrapper(cx: &CodegenCx) {
557557
// regions must appear in the argument
558558
// listing.
559559
let main_ret_ty = cx.tcx.erase_regions(
560-
&main_ret_ty.no_late_bound_regions().unwrap(),
560+
&main_ret_ty.no_bound_vars().unwrap(),
561561
);
562562

563563
if declare::get_defined_value(cx, "main").is_some() {

src/librustc_mir/borrow_check/nll/type_check/constraint_conversion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ impl<'a, 'gcx, 'tcx> ConstraintConversion<'a, 'gcx, 'tcx> {
8282
// when we move to universes, we will, and this assertion
8383
// will start to fail.
8484
let ty::OutlivesPredicate(k1, r2) =
85-
query_constraint.no_late_bound_regions().unwrap_or_else(|| {
85+
query_constraint.no_bound_vars().unwrap_or_else(|| {
8686
bug!(
87-
"query_constraint {:?} contained bound regions",
87+
"query_constraint {:?} contained bound vars",
8888
query_constraint,
8989
);
9090
});

0 commit comments

Comments
 (0)