@@ -664,6 +664,14 @@ impl<I: Interner> AliasTerm<I> {
664
664
interner. parent ( self . def_id )
665
665
}
666
666
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
+
667
675
/// Extracts the underlying trait reference from this projection.
668
676
/// For example, if this is a projection of `<T as Iterator>::Item`,
669
677
/// then this function would return a `T: Iterator` trait reference.
@@ -672,22 +680,14 @@ impl<I: Interner> AliasTerm<I> {
672
680
/// consider calling [Self::trait_ref_and_own_args] to get those
673
681
/// as well.
674
682
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
676
684
}
677
685
678
686
/// Extract the own args from this projection.
679
687
/// For example, if this is a projection of `<T as StreamingIterator>::Item<'a>`,
680
688
/// then this function would return the slice `['a]` as the own args.
681
689
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
691
691
}
692
692
}
693
693
0 commit comments