/// that this region imposes on others. The methods in this file
/// handle the part about dumping the inference context internal
/// state.
- crate fn annotate(&self, tcx: TyCtxt<'tcx>, err: &mut Diagnostic) {
+ pub(crate) fn annotate(&self, tcx: TyCtxt<'tcx>, err: &mut Diagnostic) {
match self.defining_ty {
DefiningTy::Closure(def_id, substs) => {
err.note(&format!(
fn_def_id: DefId,
mut f: impl FnMut(ty::Region<'tcx>),
) {
- if let Some((owner, late_bounds)) = tcx.is_late_bound_map(fn_def_id.expect_local()) {
+ if let Some(late_bounds) = tcx.is_late_bound_map(fn_def_id.expect_local()) {
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(),
+ scope: fn_def_id,
bound_region: ty::BoundRegionKind::BrNamed(region_def_id.to_def_id(), name),
}));
f(liberated_region);