Skip to content

Commit 4bd2fd5

Browse files
committed
Auto merge of rust-lang#117876 - lcnr:region-kind-rename, r=BoxyUwU
`ReLateBound` -> `ReBound` first step of rust-lang/types-team#95 already fairly large xx there's some future work here I intentionally did not contribute as part of this PR, from my notes: - `DescriptionCtx` to `DescriptionCtxt` - what is `CheckRegions::Bound`? - `collect_late_bound_regions` et al - `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased`? - `EraseEarlyRegions` should be removed, feels duplicate r? `@BoxyUwU`
2 parents 1ab2bcd + 8935a1b commit 4bd2fd5

File tree

93 files changed

+266
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+266
-266
lines changed

compiler/rustc_borrowck/src/diagnostics/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_hir as hir;
1010
use rustc_hir::def::{CtorKind, Namespace};
1111
use rustc_hir::CoroutineKind;
1212
use rustc_index::IndexSlice;
13-
use rustc_infer::infer::LateBoundRegionConversionTime;
13+
use rustc_infer::infer::BoundRegionConversionTime;
1414
use rustc_middle::mir::tcx::PlaceTy;
1515
use rustc_middle::mir::{
1616
AggregateKind, CallSource, ConstOperand, FakeReadCause, Local, LocalInfo, LocalKind, Location,
@@ -462,7 +462,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
462462
// lifetimes without names with the value `'0`.
463463
if let ty::Ref(region, ..) = ty.kind() {
464464
match **region {
465-
ty::ReLateBound(_, ty::BoundRegion { kind: br, .. })
465+
ty::ReBound(_, ty::BoundRegion { kind: br, .. })
466466
| ty::RePlaceholder(ty::PlaceholderRegion {
467467
bound: ty::BoundRegion { kind: br, .. },
468468
..
@@ -482,7 +482,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
482482

483483
let region = if let ty::Ref(region, ..) = ty.kind() {
484484
match **region {
485-
ty::ReLateBound(_, ty::BoundRegion { kind: br, .. })
485+
ty::ReBound(_, ty::BoundRegion { kind: br, .. })
486486
| ty::RePlaceholder(ty::PlaceholderRegion {
487487
bound: ty::BoundRegion { kind: br, .. },
488488
..
@@ -1113,7 +1113,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
11131113
&& let ty::Ref(_, _, hir::Mutability::Mut) = args.type_at(0).kind()
11141114
&& let self_ty = self.infcx.instantiate_binder_with_fresh_vars(
11151115
fn_call_span,
1116-
LateBoundRegionConversionTime::FnCall,
1116+
BoundRegionConversionTime::FnCall,
11171117
tcx.fn_sig(method_did).instantiate(tcx, method_args).input(0),
11181118
)
11191119
&& self.infcx.can_eq(self.param_env, ty, self_ty)

compiler/rustc_borrowck/src/diagnostics/region_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
357357
ty::BoundRegionKind::BrAnon => None,
358358
},
359359

360-
ty::ReLateBound(..)
360+
ty::ReBound(..)
361361
| ty::ReVar(..)
362362
| ty::RePlaceholder(..)
363363
| ty::ReErased

compiler/rustc_borrowck/src/renumber.rs

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ pub fn renumber_mir<'tcx>(
2828
renumberer.visit_body(body);
2929
}
3030

31+
// FIXME(@lcnr): A lot of these variants overlap and it seems like
32+
// this type is only used to decide which region should be used
33+
// as representative. This should be cleaned up.
3134
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
3235
pub(crate) enum RegionCtxt {
3336
Location(Location),

compiler/rustc_borrowck/src/type_check/input_output.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! `RETURN_PLACE` the MIR arguments) are always fully normalized (and
88
//! contain revealed `impl Trait` values).
99
10-
use rustc_infer::infer::LateBoundRegionConversionTime;
10+
use rustc_infer::infer::BoundRegionConversionTime;
1111
use rustc_middle::mir::*;
1212
use rustc_middle::ty::{self, Ty};
1313
use rustc_span::Span;
@@ -35,7 +35,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
3535
.instantiate_canonical_with_fresh_inference_vars(body.span, &user_provided_poly_sig);
3636
let user_provided_sig = self.infcx.instantiate_binder_with_fresh_vars(
3737
body.span,
38-
LateBoundRegionConversionTime::FnCall,
38+
BoundRegionConversionTime::FnCall,
3939
user_provided_sig,
4040
);
4141

compiler/rustc_borrowck/src/type_check/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rustc_infer::infer::outlives::env::RegionBoundPairs;
2121
use rustc_infer::infer::region_constraints::RegionConstraintData;
2222
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
2323
use rustc_infer::infer::{
24-
InferCtxt, LateBoundRegion, LateBoundRegionConversionTime, NllRegionVariableOrigin,
24+
BoundRegion, BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin,
2525
};
2626
use rustc_middle::mir::tcx::PlaceTy;
2727
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
@@ -1401,10 +1401,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14011401
};
14021402

14031403
self.infcx.next_region_var(
1404-
LateBoundRegion(
1404+
BoundRegion(
14051405
term.source_info.span,
14061406
br.kind,
1407-
LateBoundRegionConversionTime::FnCall,
1407+
BoundRegionConversionTime::FnCall,
14081408
),
14091409
region_ctxt_fn,
14101410
)

compiler/rustc_borrowck/src/type_check/relate_tys.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx>
107107
fn next_existential_region_var(
108108
&mut self,
109109
from_forall: bool,
110-
_name: Option<Symbol>,
110+
name: Option<Symbol>,
111111
) -> ty::Region<'tcx> {
112112
let origin = NllRegionVariableOrigin::Existential { from_forall };
113113

114114
let reg_var =
115-
self.type_checker.infcx.next_nll_region_var(origin, || RegionCtxt::Existential(_name));
115+
self.type_checker.infcx.next_nll_region_var(origin, || RegionCtxt::Existential(name));
116116

117117
reg_var
118118
}

compiler/rustc_borrowck/src/universal_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
665665
var: ty::BoundVar::from_usize(bound_vars.len() - 1),
666666
kind: ty::BrEnv,
667667
};
668-
let env_region = ty::Region::new_late_bound(tcx, ty::INNERMOST, br);
668+
let env_region = ty::Region::new_bound(tcx, ty::INNERMOST, br);
669669
let closure_ty = tcx.closure_env_ty(def_id, args, env_region).unwrap();
670670

671671
// The "inputs" of the closure in the

compiler/rustc_hir_analysis/src/astconv/bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
350350
let args =
351351
candidate.skip_binder().args.extend_to(tcx, assoc_item.def_id, |param, _| {
352352
let subst = match param.kind {
353-
ty::GenericParamDefKind::Lifetime => ty::Region::new_late_bound(
353+
ty::GenericParamDefKind::Lifetime => ty::Region::new_bound(
354354
tcx,
355355
ty::INNERMOST,
356356
ty::BoundRegion {

compiler/rustc_hir_analysis/src/astconv/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
250250
var: ty::BoundVar::from_u32(index),
251251
kind: ty::BrNamed(def_id, name),
252252
};
253-
ty::Region::new_late_bound(tcx, debruijn, br)
253+
ty::Region::new_bound(tcx, debruijn, br)
254254
}
255255

256256
Some(rbv::ResolvedArg::EarlyBound(def_id)) => {
@@ -1622,7 +1622,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
16221622
}
16231623

16241624
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
1625-
if r.is_late_bound() { self.tcx.lifetimes.re_erased } else { r }
1625+
// FIXME(@lcnr): This is broken, erasing bound regions
1626+
// impacts selection as it results in different types.
1627+
if r.is_bound() { self.tcx.lifetimes.re_erased } else { r }
16261628
}
16271629

16281630
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2345,7 +2345,7 @@ fn param_env_with_gat_bounds<'tcx>(
23452345
let kind = ty::BoundRegionKind::BrNamed(param.def_id, param.name);
23462346
let bound_var = ty::BoundVariableKind::Region(kind);
23472347
bound_vars.push(bound_var);
2348-
ty::Region::new_late_bound(
2348+
ty::Region::new_bound(
23492349
tcx,
23502350
ty::INNERMOST,
23512351
ty::BoundRegion {

compiler/rustc_hir_analysis/src/check/intrinsic.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
143143
]);
144144
let mk_va_list_ty = |mutbl| {
145145
tcx.lang_items().va_list().map(|did| {
146-
let region = ty::Region::new_late_bound(
146+
let region = ty::Region::new_bound(
147147
tcx,
148148
ty::INNERMOST,
149149
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon },
150150
);
151-
let env_region = ty::Region::new_late_bound(
151+
let env_region = ty::Region::new_bound(
152152
tcx,
153153
ty::INNERMOST,
154154
ty::BoundRegion { var: ty::BoundVar::from_u32(1), kind: ty::BrEnv },
@@ -411,7 +411,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
411411
1,
412412
vec![Ty::new_imm_ref(
413413
tcx,
414-
ty::Region::new_late_bound(tcx, ty::INNERMOST, br),
414+
ty::Region::new_bound(tcx, ty::INNERMOST, br),
415415
param(0),
416416
)],
417417
Ty::new_projection(tcx, discriminant_def_id, tcx.mk_args(&[param(0).into()])),
@@ -465,11 +465,8 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
465465

466466
sym::raw_eq => {
467467
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon };
468-
let param_ty = Ty::new_imm_ref(
469-
tcx,
470-
ty::Region::new_late_bound(tcx, ty::INNERMOST, br),
471-
param(0),
472-
);
468+
let param_ty =
469+
Ty::new_imm_ref(tcx, ty::Region::new_bound(tcx, ty::INNERMOST, br), param(0));
473470
(1, vec![param_ty; 2], tcx.types.bool)
474471
}
475472

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for GATSubstCollector<'tcx> {
763763
ty::Alias(ty::Projection, p) if p.def_id == self.gat => {
764764
for (idx, subst) in p.args.iter().enumerate() {
765765
match subst.unpack() {
766-
GenericArgKind::Lifetime(lt) if !lt.is_late_bound() => {
766+
GenericArgKind::Lifetime(lt) if !lt.is_bound() => {
767767
self.regions.insert((lt, idx));
768768
}
769769
GenericArgKind::Type(t) => {

compiler/rustc_hir_analysis/src/hir_wf_check.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for EraseAllBoundRegions<'tcx> {
196196
self.tcx
197197
}
198198
fn fold_region(&mut self, r: Region<'tcx>) -> Region<'tcx> {
199-
if r.is_late_bound() { self.tcx.lifetimes.re_erased } else { r }
199+
// FIXME(@lcnr): only erase escaping bound regions!
200+
if r.is_bound() { self.tcx.lifetimes.re_erased } else { r }
200201
}
201202
}

compiler/rustc_hir_analysis/src/outlives/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ fn is_free_region(region: Region<'_>) -> bool {
167167
// }
168168
//
169169
// The type above might generate a `T: 'b` bound, but we can
170-
// ignore it. We can't put it on the struct header anyway.
171-
ty::ReLateBound(..) => false,
170+
// ignore it. We can't name this lifetime pn the struct header anyway.
171+
ty::ReBound(..) => false,
172172

173173
ty::ReError(_) => false,
174174

compiler/rustc_hir_analysis/src/variance/constraints.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,11 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
419419

420420
ty::ReStatic => {}
421421

422-
ty::ReLateBound(..) => {
423-
// Late-bound regions do not get substituted the same
424-
// way early-bound regions do, so we skip them here.
422+
ty::ReBound(..) => {
423+
// Either a higher-ranked region inside of a type or a
424+
// late-bound function parameter.
425+
//
426+
// We do not compute constraints for either of these.
425427
}
426428

427429
ty::ReError(_) => {}

compiler/rustc_hir_typeck/src/check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ fn check_panic_info_fn(tcx: TyCtxt<'_>, fn_id: LocalDefId, fn_sig: ty::FnSig<'_>
214214
// build type `for<'a, 'b> fn(&'a PanicInfo<'b>) -> !`
215215
let panic_info_ty = tcx.type_of(panic_info_did).instantiate(
216216
tcx,
217-
&[ty::GenericArg::from(ty::Region::new_late_bound(
217+
&[ty::GenericArg::from(ty::Region::new_bound(
218218
tcx,
219219
ty::INNERMOST,
220220
ty::BoundRegion { var: ty::BoundVar::from_u32(1), kind: ty::BrAnon },
221221
))],
222222
);
223223
let panic_info_ref_ty = Ty::new_imm_ref(
224224
tcx,
225-
ty::Region::new_late_bound(
225+
ty::Region::new_bound(
226226
tcx,
227227
ty::INNERMOST,
228228
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon },

compiler/rustc_hir_typeck/src/closure.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_hir as hir;
77
use rustc_hir::lang_items::LangItem;
88
use rustc_hir_analysis::astconv::AstConv;
99
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
10-
use rustc_infer::infer::{DefineOpaqueTypes, LateBoundRegionConversionTime};
10+
use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes};
1111
use rustc_infer::infer::{InferOk, InferResult};
1212
use rustc_macros::{TypeFoldable, TypeVisitable};
1313
use rustc_middle::ty::visit::{TypeVisitable, TypeVisitableExt};
@@ -558,7 +558,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
558558
// Instantiate (this part of..) S to S', i.e., with fresh variables.
559559
self.instantiate_binder_with_fresh_vars(
560560
hir_ty.span,
561-
LateBoundRegionConversionTime::FnCall,
561+
BoundRegionConversionTime::FnCall,
562562
// (*) binder moved to here
563563
supplied_sig.inputs().rebind(supplied_ty),
564564
)
@@ -583,7 +583,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
583583

584584
let supplied_output_ty = self.instantiate_binder_with_fresh_vars(
585585
decl.output.span(),
586-
LateBoundRegionConversionTime::FnCall,
586+
BoundRegionConversionTime::FnCall,
587587
supplied_sig.output(),
588588
);
589589
let cause = &self.misc(decl.output.span());

compiler/rustc_hir_typeck/src/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
564564
let span = args.get(i).map(|a| a.span).unwrap_or(expr.span);
565565
let input = self.instantiate_binder_with_fresh_vars(
566566
span,
567-
infer::LateBoundRegionConversionTime::FnCall,
567+
infer::BoundRegionConversionTime::FnCall,
568568
fn_sig.input(i),
569569
);
570570
self.require_type_is_sized_deferred(
@@ -582,7 +582,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
582582
// with fresh vars.
583583
let output = self.instantiate_binder_with_fresh_vars(
584584
expr.span,
585-
infer::LateBoundRegionConversionTime::FnCall,
585+
infer::BoundRegionConversionTime::FnCall,
586586
fn_sig.output(),
587587
);
588588
self.require_type_is_sized_deferred(output, expr.span, traits::SizedReturnType);

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
289289
) -> Ty<'tcx> {
290290
let trait_ref = self.instantiate_binder_with_fresh_vars(
291291
span,
292-
infer::LateBoundRegionConversionTime::AssocTypeProjection(item_def_id),
292+
infer::BoundRegionConversionTime::AssocTypeProjection(item_def_id),
293293
poly_trait_ref,
294294
);
295295

compiler/rustc_hir_typeck/src/method/probe.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
801801
// a `&self` method will wind up with an argument type like `&dyn Trait`.
802802
let trait_ref = principal.with_self_ty(self.tcx, self_ty);
803803
self.elaborate_bounds(iter::once(trait_ref), |this, new_trait_ref, item| {
804-
if new_trait_ref.has_non_region_late_bound() {
804+
if new_trait_ref.has_non_region_bound_vars() {
805805
this.tcx.sess.delay_span_bug(
806806
this.span,
807807
"tried to select method from HRTB with non-lifetime bound vars",
@@ -853,7 +853,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
853853
self.elaborate_bounds(bounds, |this, poly_trait_ref, item| {
854854
let trait_ref = this.instantiate_binder_with_fresh_vars(
855855
this.span,
856-
infer::LateBoundRegionConversionTime::FnCall,
856+
infer::BoundRegionConversionTime::FnCall,
857857
poly_trait_ref,
858858
);
859859

@@ -971,7 +971,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
971971
} else {
972972
let new_trait_ref = self.instantiate_binder_with_fresh_vars(
973973
self.span,
974-
infer::LateBoundRegionConversionTime::FnCall,
974+
infer::BoundRegionConversionTime::FnCall,
975975
bound_trait_ref,
976976
);
977977

compiler/rustc_hir_typeck/src/writeback.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for EraseEarlyRegions<'tcx> {
784784
}
785785
}
786786
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
787-
if r.is_late_bound() { r } else { self.tcx.lifetimes.re_erased }
787+
if r.is_bound() { r } else { self.tcx.lifetimes.re_erased }
788788
}
789789
}
790790

@@ -822,7 +822,7 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Resolver<'cx, 'tcx> {
822822
}
823823

824824
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
825-
debug_assert!(!r.is_late_bound(), "Should not be resolving bound region.");
825+
debug_assert!(!r.is_bound(), "Should not be resolving bound region.");
826826
self.fcx.tcx.lifetimes.re_erased
827827
}
828828

compiler/rustc_infer/src/errors/note_and_explain.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ impl<'a> DescriptionCtx<'a> {
7373
// ReFree rather than dumping Debug output on the user.
7474
//
7575
// We shouldn't really be having unification failures with ReVar
76-
// and ReLateBound though.
77-
ty::ReVar(_) | ty::ReLateBound(..) | ty::ReErased => {
76+
// and ReBound though.
77+
//
78+
// FIXME(@lcnr): figure out why we `ReBound` have to handle `ReBound`
79+
// here, this feels somewhat off.
80+
ty::ReVar(_) | ty::ReBound(..) | ty::ReErased => {
7881
(alt_span, "revar", format!("{region:?}"))
7982
}
8083
};

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl CanonicalizeMode for CanonicalizeUserTypeAnnotation {
232232
match *r {
233233
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReErased | ty::ReStatic | ty::ReError(_) => r,
234234
ty::ReVar(_) => canonicalizer.canonical_var_for_region_in_root_universe(r),
235-
ty::RePlaceholder(..) | ty::ReLateBound(..) => {
235+
ty::RePlaceholder(..) | ty::ReBound(..) => {
236236
// We only expect region names that the user can type.
237237
bug!("unexpected region in query response: `{:?}`", r)
238238
}
@@ -343,7 +343,7 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'cx, 'tcx> {
343343

344344
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
345345
match *r {
346-
ty::ReLateBound(index, ..) => {
346+
ty::ReBound(index, ..) => {
347347
if index >= self.binder_index {
348348
bug!("escaping late-bound region during canonicalization");
349349
} else {
@@ -776,7 +776,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
776776
) -> ty::Region<'tcx> {
777777
let var = self.canonical_var(info, r.into());
778778
let br = ty::BoundRegion { var, kind: ty::BrAnon };
779-
ty::Region::new_late_bound(self.interner(), self.binder_index, br)
779+
ty::Region::new_bound(self.interner(), self.binder_index, br)
780780
}
781781

782782
/// Given a type variable `ty_var` of the given kind, first check

0 commit comments

Comments
 (0)