Skip to content

Commit f0edcc8

Browse files
committed
Remove index from BrAnon
1 parent e4edf00 commit f0edcc8

33 files changed

+68
-88
lines changed

compiler/rustc_borrowck/src/type_check/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1342,9 +1342,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13421342

13431343
let region_ctxt_fn = || {
13441344
let reg_info = match br.kind {
1345-
ty::BoundRegionKind::BrAnon(_, Some(span)) => {
1346-
BoundRegionInfo::Span(span)
1347-
}
1345+
ty::BoundRegionKind::BrAnon(Some(span)) => BoundRegionInfo::Span(span),
13481346
ty::BoundRegionKind::BrAnon(..) => {
13491347
BoundRegionInfo::Name(Symbol::intern("anon"))
13501348
}

compiler/rustc_borrowck/src/type_check/relate_tys.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx>
124124
.placeholder_region(self.type_checker.infcx, placeholder);
125125

126126
let reg_info = match placeholder.bound.kind {
127-
ty::BoundRegionKind::BrAnon(_, Some(span)) => BoundRegionInfo::Span(span),
127+
ty::BoundRegionKind::BrAnon(Some(span)) => BoundRegionInfo::Span(span),
128128
ty::BoundRegionKind::BrAnon(..) => BoundRegionInfo::Name(Symbol::intern("anon")),
129129
ty::BoundRegionKind::BrNamed(_, name) => BoundRegionInfo::Name(name),
130130
ty::BoundRegionKind::BrEnv => BoundRegionInfo::Name(Symbol::intern("env")),

compiler/rustc_hir_analysis/src/check/intrinsic.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
139139
let name_str = intrinsic_name.as_str();
140140

141141
let bound_vars = tcx.mk_bound_variable_kinds(&[
142-
ty::BoundVariableKind::Region(ty::BrAnon(0, None)),
142+
ty::BoundVariableKind::Region(ty::BrAnon(None)),
143143
ty::BoundVariableKind::Region(ty::BrEnv),
144144
]);
145145
let mk_va_list_ty = |mutbl| {
146146
tcx.lang_items().va_list().map(|did| {
147147
let region = tcx.mk_re_late_bound(
148148
ty::INNERMOST,
149-
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(0, None) },
149+
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(None) },
150150
);
151151
let env_region = tcx.mk_re_late_bound(
152152
ty::INNERMOST,
@@ -387,8 +387,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
387387
);
388388
let discriminant_def_id = assoc_items[0];
389389

390-
let br =
391-
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(0, None) };
390+
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(None) };
392391
(
393392
1,
394393
vec![tcx.mk_imm_ref(tcx.mk_re_late_bound(ty::INNERMOST, br), param(0))],
@@ -440,8 +439,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
440439
sym::nontemporal_store => (1, vec![tcx.mk_mut_ptr(param(0)), param(0)], tcx.mk_unit()),
441440

442441
sym::raw_eq => {
443-
let br =
444-
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(0, None) };
442+
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(None) };
445443
let param_ty = tcx.mk_imm_ref(tcx.mk_re_late_bound(ty::INNERMOST, br), param(0));
446444
(1, vec![param_ty; 2], tcx.types.bool)
447445
}

compiler/rustc_hir_typeck/src/generator_interior/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub fn resolve_interior<'a, 'tcx>(
240240

241241
let mut counter = 0;
242242
let mut mk_bound_region = |span| {
243-
let kind = ty::BrAnon(counter, span);
243+
let kind = ty::BrAnon(span);
244244
let var = ty::BoundVar::from_u32(counter);
245245
counter += 1;
246246
ty::BoundRegion { var, kind }
@@ -263,7 +263,7 @@ pub fn resolve_interior<'a, 'tcx>(
263263
}
264264
ty::ReLateBound(_, ty::BoundRegion { kind, .. })
265265
| ty::ReFree(ty::FreeRegion { bound_region: kind, .. }) => match kind {
266-
ty::BoundRegionKind::BrAnon(_, span) => mk_bound_region(span),
266+
ty::BoundRegionKind::BrAnon(span) => mk_bound_region(span),
267267
ty::BoundRegionKind::BrNamed(def_id, _) => {
268268
mk_bound_region(Some(fcx.tcx.def_span(def_id)))
269269
}
@@ -294,7 +294,7 @@ pub fn resolve_interior<'a, 'tcx>(
294294
FnMutDelegate {
295295
regions: &mut |br| {
296296
let kind = match br.kind {
297-
ty::BrAnon(_, span) => ty::BrAnon(counter, span),
297+
ty::BrAnon(span) => ty::BrAnon(span),
298298
_ => br.kind,
299299
};
300300
let var = ty::BoundVar::from_usize(bound_vars.len());

compiler/rustc_infer/src/errors/note_and_explain.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<'a> DescriptionCtx<'a> {
9090
};
9191
me.span = Some(sp);
9292
}
93-
ty::BrAnon(_, span) => {
93+
ty::BrAnon(span) => {
9494
me.kind = "defined_here";
9595
me.span = match span {
9696
Some(_) => span,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
772772
r: ty::Region<'tcx>,
773773
) -> ty::Region<'tcx> {
774774
let var = self.canonical_var(info, r.into());
775-
let br = ty::BoundRegion { var, kind: ty::BrAnon(var.as_u32(), None) };
775+
let br = ty::BoundRegion { var, kind: ty::BrAnon(None) };
776776
self.interner().mk_re_late_bound(self.binder_index, br)
777777
}
778778

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ fn msg_span_from_named_region<'tcx>(
174174
..
175175
}) => (format!("the lifetime `{name}` as defined here"), Some(tcx.def_span(def_id))),
176176
ty::RePlaceholder(ty::PlaceholderRegion {
177-
bound: ty::BoundRegion { kind: ty::BoundRegionKind::BrAnon(_, Some(span)), .. },
177+
bound: ty::BoundRegion { kind: ty::BoundRegionKind::BrAnon(Some(span)), .. },
178178
..
179179
}) => (format!("the anonymous lifetime defined here"), Some(span)),
180180
ty::RePlaceholder(ty::PlaceholderRegion {
181-
bound: ty::BoundRegion { kind: ty::BoundRegionKind::BrAnon(_, None), .. },
181+
bound: ty::BoundRegion { kind: ty::BoundRegionKind::BrAnon(None), .. },
182182
..
183183
}) => (format!("an anonymous lifetime"), None),
184184
_ => bug!("{:?}", region),
@@ -226,7 +226,7 @@ fn msg_span_from_early_bound_and_free_regions<'tcx>(
226226
};
227227
(text, sp)
228228
}
229-
ty::BrAnon(_, span) => (
229+
ty::BrAnon(span) => (
230230
"the anonymous lifetime as defined here".to_string(),
231231
match span {
232232
Some(span) => span,

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/placeholder_relation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
3636
ty::BrNamed(def_id, symbol) => {
3737
(Some(self.tcx().def_span(def_id)), Some(symbol))
3838
}
39-
ty::BrAnon(_, span) => (*span, None),
39+
ty::BrAnon(span) => (*span, None),
4040
ty::BrEnv => (None, None),
4141
};
4242
let (sup_span, sup_symbol) = match sup_name {
4343
ty::BrNamed(def_id, symbol) => {
4444
(Some(self.tcx().def_span(def_id)), Some(symbol))
4545
}
46-
ty::BrAnon(_, span) => (*span, None),
46+
ty::BrAnon(span) => (*span, None),
4747
ty::BrEnv => (None, None),
4848
};
4949
let diag = match (sub_span, sup_span, sub_symbol, sup_symbol) {

compiler/rustc_middle/src/infer/canonical.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ impl<'tcx> CanonicalVarValues<'tcx> {
411411
CanonicalVarKind::Region(_) | CanonicalVarKind::PlaceholderRegion(_) => {
412412
let br = ty::BoundRegion {
413413
var: ty::BoundVar::from_usize(i),
414-
kind: ty::BrAnon(i as u32, None),
414+
kind: ty::BrAnon(None),
415415
};
416416
tcx.mk_re_late_bound(ty::INNERMOST, br).into()
417417
}

compiler/rustc_middle/src/mir/query.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,8 @@ impl<'tcx> ClosureOutlivesSubjectTy<'tcx> {
411411
pub fn bind(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Self {
412412
let inner = tcx.fold_regions(ty, |r, depth| match r.kind() {
413413
ty::ReVar(vid) => {
414-
let br = ty::BoundRegion {
415-
var: ty::BoundVar::new(vid.index()),
416-
kind: ty::BrAnon(vid.as_u32(), None),
417-
};
414+
let br =
415+
ty::BoundRegion { var: ty::BoundVar::new(vid.index()), kind: ty::BrAnon(None) };
418416
tcx.mk_re_late_bound(depth, br)
419417
}
420418
_ => bug!("unexpected region in ClosureOutlivesSubjectTy: {r:?}"),

compiler/rustc_middle/src/ty/context.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pub struct CommonLifetimes<'tcx> {
311311
pub re_vars: Vec<Region<'tcx>>,
312312

313313
/// Pre-interned values of the form:
314-
/// `ReLateBound(DebruijnIndex(i), BoundRegion { var: v, kind: BrAnon(v, None) })`
314+
/// `ReLateBound(DebruijnIndex(i), BoundRegion { var: v, kind: BrAnon(None) })`
315315
/// for small values of `i` and `v`.
316316
pub re_late_bounds: Vec<Vec<Region<'tcx>>>,
317317
}
@@ -386,10 +386,7 @@ impl<'tcx> CommonLifetimes<'tcx> {
386386
.map(|v| {
387387
mk(ty::ReLateBound(
388388
ty::DebruijnIndex::from(i),
389-
ty::BoundRegion {
390-
var: ty::BoundVar::from(v),
391-
kind: ty::BrAnon(v, None),
392-
},
389+
ty::BoundRegion { var: ty::BoundVar::from(v), kind: ty::BrAnon(None) },
393390
))
394391
})
395392
.collect()
@@ -2075,10 +2072,9 @@ impl<'tcx> TyCtxt<'tcx> {
20752072
bound_region: ty::BoundRegion,
20762073
) -> Region<'tcx> {
20772074
// Use a pre-interned one when possible.
2078-
if let ty::BoundRegion { var, kind: ty::BrAnon(v, None) } = bound_region
2079-
&& var.as_u32() == v
2075+
if let ty::BoundRegion { var, kind: ty::BrAnon(None) } = bound_region
20802076
&& let Some(inner) = self.lifetimes.re_late_bounds.get(debruijn.as_usize())
2081-
&& let Some(re) = inner.get(v as usize).copied()
2077+
&& let Some(re) = inner.get(var.as_usize()).copied()
20822078
{
20832079
re
20842080
} else {

compiler/rustc_middle/src/ty/fold.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,7 @@ impl<'tcx> TyCtxt<'tcx> {
379379
let index = entry.index();
380380
let var = ty::BoundVar::from_usize(index);
381381
let kind = entry
382-
.or_insert_with(|| {
383-
ty::BoundVariableKind::Region(ty::BrAnon(index as u32, None))
384-
})
382+
.or_insert_with(|| ty::BoundVariableKind::Region(ty::BrAnon(None)))
385383
.expect_region();
386384
let br = ty::BoundRegion { var, kind };
387385
self.tcx.mk_re_late_bound(ty::INNERMOST, br)

compiler/rustc_middle/src/ty/structural_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'tcx> fmt::Debug for ty::adjustment::Adjustment<'tcx> {
6868
impl fmt::Debug for ty::BoundRegionKind {
6969
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7070
match *self {
71-
ty::BrAnon(n, span) => write!(f, "BrAnon({n:?}, {span:?})"),
71+
ty::BrAnon(span) => write!(f, "BrAnon({span:?})"),
7272
ty::BrNamed(did, name) => {
7373
if did.is_crate_root() {
7474
write!(f, "BrNamed({})", name)

compiler/rustc_middle/src/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub struct FreeRegion {
6060
#[derive(HashStable)]
6161
pub enum BoundRegionKind {
6262
/// An anonymous region parameter for a given fn (&T)
63-
BrAnon(u32, Option<Span>),
63+
BrAnon(Option<Span>),
6464

6565
/// Named region parameters for functions (a in &'a T)
6666
///

compiler/rustc_symbol_mangling/src/v0.rs

+12-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc_data_structures::base_n;
2-
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
2+
use rustc_data_structures::fx::FxHashMap;
33
use rustc_data_structures::intern::Interned;
44
use rustc_hir as hir;
55
use rustc_hir::def::CtorKind;
@@ -81,9 +81,9 @@ pub(super) fn mangle_typeid_for_trait_ref<'tcx>(
8181
struct BinderLevel {
8282
/// The range of distances from the root of what's
8383
/// being printed, to the lifetimes in a binder.
84-
/// Specifically, a `BrAnon(i)` lifetime has depth
85-
/// `lifetime_depths.start + i`, going away from the
86-
/// the root and towards its use site, as `i` increases.
84+
/// Specifically, a `BrAnon` lifetime has depth
85+
/// `lifetime_depths.start + index`, going away from the
86+
/// the root and towards its use site, as the var index increases.
8787
/// This is used to flatten rustc's pairing of `BrAnon`
8888
/// (intra-binder disambiguation) with a `DebruijnIndex`
8989
/// (binder addressing), to "true" de Bruijn indices,
@@ -208,24 +208,15 @@ impl<'tcx> SymbolMangler<'tcx> {
208208
where
209209
T: TypeVisitable<TyCtxt<'tcx>>,
210210
{
211-
// FIXME(non-lifetime-binders): What to do here?
212-
let regions = if value.has_late_bound_regions() {
213-
self.tcx.collect_referenced_late_bound_regions(value)
214-
} else {
215-
FxHashSet::default()
216-
};
217-
218211
let mut lifetime_depths =
219212
self.binders.last().map(|b| b.lifetime_depths.end).map_or(0..0, |i| i..i);
220213

221-
let lifetimes = regions
222-
.into_iter()
223-
.map(|br| match br {
224-
ty::BrAnon(i, _) => i,
225-
_ => bug!("symbol_names: non-anonymized region `{:?}` in `{:?}`", br, value),
226-
})
227-
.max()
228-
.map_or(0, |max| max + 1);
214+
// FIXME(non-lifetime-binders): What to do here?
215+
let lifetimes = value
216+
.bound_vars()
217+
.iter()
218+
.filter(|var| matches!(var, ty::BoundVariableKind::Region(..)))
219+
.count() as u32;
229220

230221
self.push_opt_integer_62("G", lifetimes as u64);
231222
lifetime_depths.end += lifetimes;
@@ -338,9 +329,9 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
338329

339330
// Late-bound lifetimes use indices starting at 1,
340331
// see `BinderLevel` for more details.
341-
ty::ReLateBound(debruijn, ty::BoundRegion { kind: ty::BrAnon(i, _), .. }) => {
332+
ty::ReLateBound(debruijn, ty::BoundRegion { var, kind: ty::BrAnon(_) }) => {
342333
let binder = &self.binders[self.binders.len() - 1 - debruijn.index()];
343-
let depth = binder.lifetime_depths.start + i;
334+
let depth = binder.lifetime_depths.start + var.as_u32();
344335

345336
1 + (self.binders.last().unwrap().lifetime_depths.end - 1 - depth)
346337
}

compiler/rustc_trait_selection/src/solve/canonicalize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
257257
self.primitive_var_infos.push(CanonicalVarInfo { kind });
258258
var
259259
});
260-
let br = ty::BoundRegion { var, kind: BrAnon(var.as_u32(), None) };
260+
let br = ty::BoundRegion { var, kind: BrAnon(None) };
261261
self.interner().mk_re_late_bound(self.binder_index, br)
262262
}
263263

compiler/rustc_trait_selection/src/traits/select/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,7 @@ fn bind_generator_hidden_types_above<'tcx>(
30173017
if let ty::ReErased = r.kind() {
30183018
let br = ty::BoundRegion {
30193019
var: ty::BoundVar::from_u32(counter),
3020-
kind: ty::BrAnon(counter, None),
3020+
kind: ty::BrAnon(None),
30213021
};
30223022
counter += 1;
30233023
r = tcx.mk_re_late_bound(current_depth, br);
@@ -3033,7 +3033,7 @@ fn bind_generator_hidden_types_above<'tcx>(
30333033
debug_assert!(!hidden_types.has_erased_regions());
30343034
}
30353035
let bound_vars = tcx.mk_bound_variable_kinds_from_iter(bound_vars.iter().chain(
3036-
(num_bound_variables..counter).map(|i| ty::BoundVariableKind::Region(ty::BrAnon(i, None))),
3036+
(num_bound_variables..counter).map(|_| ty::BoundVariableKind::Region(ty::BrAnon(None))),
30373037
));
30383038
ty::Binder::bind_with_vars(hidden_types, bound_vars)
30393039
}

compiler/rustc_traits/src/chalk/db.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ fn bound_vars_for_item(tcx: TyCtxt<'_>, def_id: DefId) -> SubstsRef<'_> {
730730
ty::GenericParamDefKind::Lifetime => {
731731
let br = ty::BoundRegion {
732732
var: ty::BoundVar::from_usize(substs.len()),
733-
kind: ty::BrAnon(substs.len() as u32, None),
733+
kind: ty::BrAnon(None),
734734
};
735735
tcx.mk_re_late_bound(ty::INNERMOST, br).into()
736736
}

compiler/rustc_traits/src/chalk/lowering.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -533,15 +533,15 @@ impl<'tcx> LowerInto<'tcx, Region<'tcx>> for &chalk_ir::Lifetime<RustInterner<'t
533533
ty::DebruijnIndex::from_u32(var.debruijn.depth()),
534534
ty::BoundRegion {
535535
var: ty::BoundVar::from_usize(var.index),
536-
kind: ty::BrAnon(var.index as u32, None),
536+
kind: ty::BrAnon(None),
537537
},
538538
),
539539
chalk_ir::LifetimeData::InferenceVar(_var) => unimplemented!(),
540540
chalk_ir::LifetimeData::Placeholder(p) => tcx.mk_re_placeholder(ty::Placeholder {
541541
universe: ty::UniverseIndex::from_usize(p.ui.counter),
542542
bound: ty::BoundRegion {
543543
var: ty::BoundVar::from_usize(p.idx),
544-
kind: ty::BoundRegionKind::BrAnon(p.idx as u32, None),
544+
kind: ty::BoundRegionKind::BrAnon(None),
545545
},
546546
}),
547547
chalk_ir::LifetimeData::Static => tcx.lifetimes.re_static,
@@ -976,7 +976,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for BoundVarsCollector<'tcx> {
976976
}
977977
}
978978

979-
ty::BoundRegionKind::BrAnon(var, _) => match self.parameters.entry(var) {
979+
ty::BoundRegionKind::BrAnon(_) => match self.parameters.entry(br.var.as_u32()) {
980980
Entry::Vacant(entry) => {
981981
entry.insert(chalk_ir::VariableKind::Lifetime);
982982
}
@@ -1036,8 +1036,8 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for NamedBoundVarSubstitutor<'a, 'tcx> {
10361036
match *r {
10371037
ty::ReLateBound(index, br) if index == self.binder_index => match br.kind {
10381038
ty::BrNamed(def_id, _name) => match self.named_parameters.get(&def_id) {
1039-
Some(idx) => {
1040-
let new_br = ty::BoundRegion { var: br.var, kind: ty::BrAnon(*idx, None) };
1039+
Some(_) => {
1040+
let new_br = ty::BoundRegion { var: br.var, kind: ty::BrAnon(None) };
10411041
return self.tcx.mk_re_late_bound(index, new_br);
10421042
}
10431043
None => panic!("Missing `BrNamed`."),
@@ -1127,15 +1127,15 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ParamsSubstitutor<'tcx> {
11271127
Some(idx) => {
11281128
let br = ty::BoundRegion {
11291129
var: ty::BoundVar::from_u32(*idx),
1130-
kind: ty::BrAnon(*idx, None),
1130+
kind: ty::BrAnon(None),
11311131
};
11321132
self.tcx.mk_re_late_bound(self.binder_index, br)
11331133
}
11341134
None => {
11351135
let idx = self.named_regions.len() as u32;
11361136
let br = ty::BoundRegion {
11371137
var: ty::BoundVar::from_u32(idx),
1138-
kind: ty::BrAnon(idx, None),
1138+
kind: ty::BrAnon(None),
11391139
};
11401140
self.named_regions.insert(_re.def_id, idx);
11411141
self.tcx.mk_re_late_bound(self.binder_index, br)
@@ -1213,8 +1213,9 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for PlaceholdersCollector {
12131213
fn visit_region(&mut self, r: Region<'tcx>) -> ControlFlow<Self::BreakTy> {
12141214
match *r {
12151215
ty::RePlaceholder(p) if p.universe == self.universe_index => {
1216-
if let ty::BoundRegionKind::BrAnon(anon, _) = p.bound.kind {
1217-
self.next_anon_region_placeholder = self.next_anon_region_placeholder.max(anon);
1216+
if let ty::BoundRegionKind::BrAnon(_) = p.bound.kind {
1217+
self.next_anon_region_placeholder =
1218+
self.next_anon_region_placeholder.max(p.bound.var.as_u32());
12181219
}
12191220
// FIXME: This doesn't seem to handle BrNamed at all?
12201221
}

0 commit comments

Comments
 (0)