@@ -664,6 +664,14 @@ impl<I: Interner> AliasTerm<I> {
664664 interner. parent ( self . def_id )
665665 }
666666
667+ /// Extracts the underlying trait reference and own args from this projection.
668+ /// For example, if this is a projection of `<T as StreamingIterator>::Item<'a>`,
669+ /// then this function would return a `T: StreamingIterator` trait reference and
670+ /// `['a]` as the own args.
671+ pub fn trait_ref_and_own_args ( self , interner : I ) -> ( TraitRef < I > , I :: GenericArgsSlice ) {
672+ interner. trait_ref_and_own_args_for_alias ( self . def_id , self . args )
673+ }
674+
667675 /// Extracts the underlying trait reference from this projection.
668676 /// For example, if this is a projection of `<T as Iterator>::Item`,
669677 /// then this function would return a `T: Iterator` trait reference.
@@ -672,22 +680,14 @@ impl<I: Interner> AliasTerm<I> {
672680 /// consider calling [Self::trait_ref_and_own_args] to get those
673681 /// as well.
674682 pub fn trait_ref ( self , interner : I ) -> TraitRef < I > {
675- interner . trait_ref_for_alias ( self . def_id , self . args )
683+ self . trait_ref_and_own_args ( interner ) . 0
676684 }
677685
678686 /// Extract the own args from this projection.
679687 /// For example, if this is a projection of `<T as StreamingIterator>::Item<'a>`,
680688 /// then this function would return the slice `['a]` as the own args.
681689 pub fn own_args ( self , interner : I ) -> I :: GenericArgsSlice {
682- interner. own_args_for_alias ( self . def_id , self . args )
683- }
684-
685- /// Extracts the underlying trait reference and own args from this projection.
686- /// For example, if this is a projection of `<T as StreamingIterator>::Item<'a>`,
687- /// then this function would return a `T: StreamingIterator` trait reference and
688- /// `['a]` as the own args.
689- pub fn trait_ref_and_own_args ( self , interner : I ) -> ( TraitRef < I > , I :: GenericArgsSlice ) {
690- interner. trait_ref_and_own_args_for_alias ( self . def_id , self . args )
690+ self . trait_ref_and_own_args ( interner) . 1
691691 }
692692}
693693
0 commit comments