pub fn flatten_late_bound_regions<T>(&self, bound2_value: &Binder<Binder<T>>)
                                         -> Binder<T>
        where T: TypeFoldable<'tcx>
    {
        let bound0_value = bound2_value.skip_binder().skip_binder();
        let value = self.fold_regions(bound0_value, &mut false,
                                      |region, current_depth| {
            match region {
                ty::ReLateBound(debruijn, br) if debruijn.depth >= current_depth => {
                    // should be true if no escaping regions from bound2_value
                    assert!(debruijn.depth - current_depth <= 1);
                    ty::ReLateBound(ty::DebruijnIndex::new(current_depth), br)
                }
                _ => {
                    region
                }
            }
        });
        Binder(value)
    }
/// Flattens two binding levels into one. So `for<'a> for<'b> Foo`
/// becomes `for<'a,'b> Foo`.
Flattens two binding levels into one.
Flattens two binding levels into one .
pub fn flatten_late_bound_regions<T>(&self, bound2_value: &Binder<Binder<T>>)
                                         -> Binder<T>
        where T: TypeFoldable<'tcx>
    {
        let bound0_value = bound2_value.skip_binder().skip_binder();
        let value = self.fold_regions(bound0_value, &mut false,
                                      |region, current_depth| {
            match region {
                ty::ReLateBound(debruijn, br) if debruijn.depth >= current_depth => {
                    // should be true if no escaping regions from bound2_value
                    assert!(debruijn.depth - current_depth <= 1);
                    ty::ReLateBound(ty::DebruijnIndex::new(current_depth), br)
                }
                _ => {
                    region
                }
            }
        });
        Binder(value)
    }
pub fn flatten_late_bound_regions < T > ( & self , bound2_value : & Binder < Binder < T > > ) -> Binder < T > where T : TypeFoldable < ' tcx > { let bound0_value = bound2_value . skip_binder ( ) . skip_binder ( ) ; let value = self . fold_regions ( bound0_value , & mut false , | region , current_depth | { match region { ty :: ReLateBound ( debruijn , br ) if debruijn . depth >= current_depth => { // should be true if no escaping regions from bound2_value assert ! ( debruijn depth current_depth 1 ) ; ty :: ReLateBound ( ty :: DebruijnIndex :: new ( current_depth ) , br ) } _ => { region } } } ) ; Binder ( value ) }
Flattens two binding levels into one.
Flattens two binding levels into one .
&self
bound2_value
&Binder<Binder<T>>