File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,27 @@ pub(super) fn push_trait_super_clauses<I: Interner>(
7373 }
7474}
7575
76+ /// Returns super-`TraitRef`s and super-`Projection`s that are quantified over the parameters of
77+ /// `trait_id` and relevant higher-ranked lifetimes. The outer `Binders` is for the former and the
78+ /// inner `Binders` is for the latter.
79+ ///
80+ /// For example, given the following trait definitions and `C` as `trait_id`,
81+ ///
82+ /// ```
83+ /// trait A<'a, T> {}
84+ /// trait B<'b, U> where Self: for<'x> A<'x, U> {}
85+ /// trait C<'c, V> where Self: B<'c, V> {}
86+ /// ```
87+ ///
88+ /// returns the following quantified `TraitRef`s.
89+ ///
90+ /// ```notrust
91+ /// for<Self, 'c, V> {
92+ /// for<'x> { Self: A<'x, V> }
93+ /// for<> { Self: B<'c, V> }
94+ /// for<> { Self: C<'c, V> }
95+ /// }
96+ /// ```
7697pub ( crate ) fn super_traits < I : Interner > (
7798 db : & dyn RustIrDatabase < I > ,
7899 trait_id : TraitId < I > ,
You can’t perform that action at this time.
0 commit comments