///
/// Consider this example:
///
- /// ```
+ /// ```ignore (pseudo-rust)
/// fn foo<'a, 'b>(a: &'a u32, b: &'b u32, c: &'static u32) {
/// let closure = for<'x> |x: &'x u32| { .. };
- /// ^^^^^^^ pretend this were legal syntax
- /// for declaring a late-bound region in
- /// a closure signature
+ /// // ^^^^^^^ pretend this were legal syntax
+ /// // for declaring a late-bound region in
+ /// // a closure signature
/// }
/// ```
///
mut f: impl FnMut(ty::Region<'tcx>),
) {
if let Some((owner, late_bounds)) = tcx.is_late_bound_map(fn_def_id.expect_local()) {
- for &late_bound in late_bounds.iter() {
- let hir_id = HirId { owner, local_id: late_bound };
- let name = tcx.hir().name(hir_id);
- let region_def_id = tcx.hir().local_def_id(hir_id);
+ for ®ion_def_id in late_bounds.iter() {
+ let name = tcx.item_name(region_def_id.to_def_id());
let liberated_region = tcx.mk_region(ty::ReFree(ty::FreeRegion {
scope: owner.to_def_id(),
bound_region: ty::BoundRegionKind::BrNamed(region_def_id.to_def_id(), name),