@@ -107,7 +107,7 @@ impl ImplDatum {
107
107
/// Given `impl<T: Clone> Clone for Vec<T>`, generate:
108
108
///
109
109
/// ```notrust
110
- /// forall<T> { (Vec<T>: Clone) :- (T: Clone) }
110
+ /// forall<T> { Implemented (Vec<T>: Clone) :- Implemented (T: Clone) }
111
111
/// ```
112
112
fn to_program_clause ( & self ) -> ProgramClause {
113
113
self . binders
@@ -137,9 +137,9 @@ impl DefaultImplDatum {
137
137
///
138
138
/// ```notrust
139
139
/// forall<T> {
140
- /// (MyList<T>: Send) :-
141
- /// (T: Send),
142
- /// (Box<Option<MyList<T>>>: Send)
140
+ /// Implemented (MyList<T>: Send) :-
141
+ /// Implemented (T: Send),
142
+ /// Implemented (Box<Option<MyList<T>>>: Send)
143
143
/// }
144
144
/// ```
145
145
fn to_program_clause ( & self ) -> ProgramClause {
@@ -179,8 +179,8 @@ impl AssociatedTyValue {
179
179
/// ```notrust
180
180
/// forall<'a, T> {
181
181
/// Normalize(<Vec<T> as Iterable>::IntoIter<'a> -> Iter<'a, T>>) :-
182
- /// (Vec<T>: Iterable), // (1)
183
- /// (Iter<'a, T>: 'a) // (2)
182
+ /// Implemented (Vec<T>: Iterable), // (1)
183
+ /// Implemented (Iter<'a, T>: 'a) // (2)
184
184
/// }
185
185
/// ```
186
186
///
@@ -304,7 +304,7 @@ impl StructDatum {
304
304
//
305
305
// we generate the following clauses:
306
306
//
307
- // forall<T> { WF(Foo<T>) :- (T: Eq). }
307
+ // forall<T> { WF(Foo<T>) :- Implemented (T: Eq). }
308
308
// forall<T> { FromEnv(T: Eq) :- FromEnv(Foo<T>). }
309
309
// forall<T> { IsFullyVisible(Foo<T>) :- IsFullyVisible(T) }
310
310
//
@@ -456,7 +456,7 @@ impl TraitDatum {
456
456
// we generate the following clause:
457
457
//
458
458
// forall<Self, T> {
459
- // WF(Self: Ord<T>) :- (Self: Ord<T>), WF(Self: Eq<T>)
459
+ // WF(Self: Ord<T>) :- Implemented (Self: Ord<T>), WF(Self: Eq<T>)
460
460
// }
461
461
//
462
462
// and the reverse rules:
@@ -786,7 +786,7 @@ impl AssociatedTyDatum {
786
786
// Well-formedness of projection type.
787
787
//
788
788
// forall<Self> {
789
- // WellFormed((Foo::Assoc)<Self>) :- Self: Foo, WC.
789
+ // WellFormed((Foo::Assoc)<Self>) :- Implemented( Self: Foo) , WC.
790
790
// }
791
791
clauses. push (
792
792
Binders {
@@ -837,12 +837,23 @@ impl AssociatedTyDatum {
837
837
838
838
// Reverse rule for implied bounds.
839
839
//
840
- // forall<T > {
841
- // FromEnv(<T as Foo>::Assoc: Bounds) :- FromEnv(Self: Foo)
840
+ // forall<Self > {
841
+ // FromEnv(<Self as Foo>::Assoc: Bounds) :- FromEnv(Self: Foo), FromEnv(WC )
842
842
// }
843
843
clauses. extend ( self . bounds_on_self ( ) . into_iter ( ) . map ( |bound| {
844
844
// Same as above in case of higher-ranked inline bounds.
845
845
let shift = bound. binders . len ( ) ;
846
+ let from_env_trait = iter:: once (
847
+ FromEnv :: Trait ( trait_ref. clone ( ) ) . shifted_in ( shift) . cast ( )
848
+ ) ;
849
+
850
+ let where_clauses = self . where_clauses
851
+ . iter ( )
852
+ . cloned ( )
853
+ // `wc` may be a higher-ranked where clause
854
+ . map ( |wc| wc. map ( |value| value. into_from_env_goal ( ) ) )
855
+ . casted ( ) ;
856
+
846
857
Binders {
847
858
binders : bound
848
859
. binders
@@ -852,7 +863,7 @@ impl AssociatedTyDatum {
852
863
. collect ( ) ,
853
864
value : ProgramClauseImplication {
854
865
consequence : bound. value . clone ( ) . into_from_env_goal ( ) ,
855
- conditions : vec ! [ FromEnv :: Trait ( trait_ref . clone ( ) ) . shifted_in ( shift ) . cast ( ) ] ,
866
+ conditions : from_env_trait . chain ( where_clauses ) . collect ( ) ,
856
867
} ,
857
868
} . cast ( )
858
869
} ) ) ;
0 commit comments