fn erase_late_bound_regions<T>(&self, value: &ty::Binder<T>) -> T
        where T : TypeFoldable<'tcx>
    {
        self.tcx().erase_late_bound_regions(value)
    }
/// Replace late-bound-regions bound by `value` with `'static` using
/// `ty::erase_late_bound_regions`.
///
/// This is only a reasonable thing to do during the *probe* phase, not the *confirm* phase, of
/// method matching. It is reasonable during the probe phase because we don't consider region
/// relationships at all. Therefore, we can just replace all the region variables with 'static
/// rather than creating fresh region variables. This is nice for two reasons:
///
/// 1. Because the numbers of the region variables would otherwise be fairly unique to this
///    particular method call, it winds up creating fewer types overall, which helps for memory
///    usage. (Admittedly, this is a rather small effect, though measureable.)
///
/// 2. It makes it easier to deal with higher-ranked trait bounds, because we can replace any
///    late-bound regions with 'static. Otherwise, if we were going to replace late-bound
///    regions with actual region variables as is proper, we'd have to ensure that the same
///    region got replaced with the same variable, which requires a bit more coordination
///    and/or tracking the substitution and
///    so forth.


This is only a reasonable thing to do during the *probe* phase, not the *confirm* phase, of
method matching. It is reasonable during the probe phase because we don't consider region
relationships at all. Therefore, we can just replace all the region variables with 'static
rather than creating fresh region variables. This is nice for two reasons.

1. Because the numbers of the region variables would otherwise be fairly unique to this
particular method call, it winds up creating fewer types overall, which helps for memory
usage. (Admittedly, this is a rather small effect, though measureable.)

2. It makes it easier to deal with higher-ranked trait bounds, because we can replace any
late-bound regions with 'static. Otherwise, if we were going to replace late-bound
regions with actual region variables as is proper, we'd have to ensure that the same
region got replaced with the same variable, which requires a bit more coordination
and/or tracking the substitution and
so forth.
This is only a reasonable thing to do during the * probe * phase not the * confirm * phase of method matching . It is reasonable during the probe phase because we don ' t consider region relationships at all . Therefore we can just replace all the region variables with ' static rather than creating fresh region variables . This is nice for two reasons . 1 . Because the numbers of the region variables would otherwise be fairly unique to this particular method call it winds up creating fewer types overall which helps for memory usage . ( Admittedly this is a rather small effect though measureable . ) 2 . It makes it easier to deal with higher - ranked trait bounds because we can replace any late - bound regions with ' static . Otherwise if we were going to replace late - bound regions with actual region variables as is proper we ' d have to ensure that the same region got replaced with the same variable which requires a bit more coordination and / or tracking the substitution and so forth .
fn erase_late_bound_regions<T>(&self, value: &ty::Binder<T>) -> T
        where T : TypeFoldable<'tcx>
    {
        self.tcx().erase_late_bound_regions(value)
    }
fn erase_late_bound_regions < T > ( & self , value : & ty :: Binder < T > ) -> T where T : TypeFoldable < ' tcx > { self . tcx ( ) . erase_late_bound_regions ( value ) }
Replace late-bound-regions bound by `value` with `'static` using
`ty::erase_late_bound_regions`.
Replace late - bound - regions bound by ` value ` with ` ' static ` using ` ty :: erase_late_bound_regions ` .
&self
value
&ty::Binder<T>
&self
value
&ty::Binder<T>