diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-30 00:17:41 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-10 13:36:06 +0200 |
| commit | 69d818333755d4b836a28a4498f2caad71c2d014 (patch) | |
| tree | 14e247f2edb8bb6c657e18d5d20b92610a360c0f /compiler/rustc_borrowck | |
| parent | db03a2deb090d5c24f15ef30cf4e5ccb13690b9d (diff) | |
| download | rust-69d818333755d4b836a28a4498f2caad71c2d014.tar.gz rust-69d818333755d4b836a28a4498f2caad71c2d014.zip | |
Store LocalDefId in is_late_bound_map.
This allows to avoid looking at HIR from borrowck.
Diffstat (limited to 'compiler/rustc_borrowck')
| -rw-r--r-- | compiler/rustc_borrowck/src/universal_regions.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_borrowck/src/universal_regions.rs b/compiler/rustc_borrowck/src/universal_regions.rs index 28a566ca408..e26adba0d30 100644 --- a/compiler/rustc_borrowck/src/universal_regions.rs +++ b/compiler/rustc_borrowck/src/universal_regions.rs @@ -828,13 +828,11 @@ fn for_each_late_bound_region_defined_on<'tcx>( 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 region_def_id = - tcx.hir().local_def_id(HirId { owner, local_id: late_bound }).to_def_id(); - let name = tcx.item_name(region_def_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, name), + bound_region: ty::BoundRegionKind::BrNamed(region_def_id.to_def_id(), name), })); f(liberated_region); } |
