We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36ddb8a commit 30d8323Copy full SHA for 30d8323
chalk-solve/src/clauses.rs
@@ -167,6 +167,23 @@ fn program_clauses_that_could_match(
167
}
168
169
170
+ // Check for impl and dyn Traits so that we generate
171
+ // `Implemented(impl Foo + Bar) :- Implemented(Foo), Implemented(Bar)`
172
+ match trait_ref.self_type_parameter() {
173
+ Some(Ty::Opaque(qwc)) | Some(Ty::Dyn(qwc)) => {
174
+ clauses.push(ProgramClauseImplication {
175
+ consequence: trait_ref.clone().cast(),
176
+ conditions: qwc
177
+ .value
178
+ .iter()
179
+ .cloned()
180
+ .casted()
181
+ .collect(),
182
+ }.cast());
183
+ }
184
+ _ => {}
185
186
+
187
// TODO sized, unsize_trait, builtin impls?
188
189
DomainGoal::Holds(WhereClause::ProjectionEq(projection_predicate)) => {
0 commit comments