pub fn struct_lockstep_tails(self,
                                 source: Ty<'tcx>,
                                 target: Ty<'tcx>)
                                 -> (Ty<'tcx>, Ty<'tcx>) {
        let (mut a, mut b) = (source, target);
        while let (&TyAdt(a_def, a_substs), &TyAdt(b_def, b_substs)) = (&a.sty, &b.sty) {
            if a_def != b_def || !a_def.is_struct() {
                break
            }
            match a_def.struct_variant().fields.last() {
                Some(f) => {
                    a = f.ty(self, a_substs);
                    b = f.ty(self, b_substs);
                }
                _ => break
            }
        }
        (a, b)
    }
/// Same as applying struct_tail on `source` and `target`, but only
/// keeps going as long as the two types are instances of the same
/// structure definitions.
/// For `(Foo<Foo<T>>, Foo<Trait>)`, the result will be `(Foo<T>, Trait)`,
/// whereas struct_tail produces `T`, and `Trait`, respectively.
Same as applying struct_tail on `source` and `target`, but only
keeps going as long as the two types are instances of the same
structure definitions.
Same as applying struct_tail on ` source ` and ` target ` but only keeps going as long as the two types are instances of the same structure definitions .
pub fn struct_lockstep_tails(self,
                                 source: Ty<'tcx>,
                                 target: Ty<'tcx>)
                                 -> (Ty<'tcx>, Ty<'tcx>) {
        let (mut a, mut b) = (source, target);
        while let (&TyAdt(a_def, a_substs), &TyAdt(b_def, b_substs)) = (&a.sty, &b.sty) {
            if a_def != b_def || !a_def.is_struct() {
                break
            }
            match a_def.struct_variant().fields.last() {
                Some(f) => {
                    a = f.ty(self, a_substs);
                    b = f.ty(self, b_substs);
                }
                _ => break
            }
        }
        (a, b)
    }
pub fn struct_lockstep_tails ( self , source : Ty < ' tcx > , target : Ty < ' tcx > ) -> ( Ty < ' tcx > , Ty < ' tcx > ) { let ( mut a , mut b ) = ( source , target ) ; while let ( & TyAdt ( a_def , a_substs ) , & TyAdt ( b_def , b_substs ) ) = ( & a . sty , & b . sty ) { if a_def != b_def || ! a_def . is_struct ( ) { break } match a_def . struct_variant ( ) . fields . last ( ) { Some ( f ) => { a = f . ty ( self , a_substs ) ; b = f . ty ( self , b_substs ) ; } _ => break } } ( a , b ) }
Same as applying struct_tail on `source` and `target`, but only
keeps going as long as the two types are instances of the same
structure definitions.
Same as applying struct_tail on ` source ` and ` target ` but only keeps going as long as the two types are instances of the same structure definitions .
self
source
Ty<'tcx>
target
Ty<'tcx>