@@ -244,16 +244,21 @@ fn program_clauses_that_could_match<I: Interner>(
244244 . opaque_ty_data ( opaque_ty. opaque_ty_id )
245245 . to_program_clauses ( builder) ,
246246 } ,
247- DomainGoal :: WellFormed ( WellFormed :: Trait ( trait_predicate) ) => {
248- db. trait_datum ( trait_predicate. trait_id )
247+ DomainGoal :: WellFormed ( WellFormed :: Trait ( trait_ref) )
248+ | DomainGoal :: LocalImplAllowed ( trait_ref) => {
249+ db. trait_datum ( trait_ref. trait_id )
249250 . to_program_clauses ( builder) ;
250251 }
252+ DomainGoal :: ObjectSafe ( trait_id) => {
253+ if builder. db . is_object_safe ( * trait_id) {
254+ builder. push_fact ( DomainGoal :: ObjectSafe ( * trait_id) ) ;
255+ }
256+ }
251257 DomainGoal :: WellFormed ( WellFormed :: Ty ( ty) )
252258 | DomainGoal :: IsUpstream ( ty)
253- | DomainGoal :: DownstreamType ( ty) => match_ty ( builder, environment, ty) ?,
254- DomainGoal :: IsFullyVisible ( ty) | DomainGoal :: IsLocal ( ty) => {
255- match_ty ( builder, environment, ty) ?
256- }
259+ | DomainGoal :: DownstreamType ( ty)
260+ | DomainGoal :: IsFullyVisible ( ty)
261+ | DomainGoal :: IsLocal ( ty) => match_ty ( builder, environment, ty) ?,
257262 DomainGoal :: FromEnv ( _) => ( ) , // Computed in the environment
258263 DomainGoal :: Normalize ( Normalize { alias, ty : _ } ) => match alias {
259264 AliasTy :: Projection ( proj) => {
@@ -291,11 +296,7 @@ fn program_clauses_that_could_match<I: Interner>(
291296 }
292297 AliasTy :: Opaque ( _) => ( ) ,
293298 } ,
294- DomainGoal :: LocalImplAllowed ( trait_ref) => db
295- . trait_datum ( trait_ref. trait_id )
296- . to_program_clauses ( builder) ,
297- DomainGoal :: Compatible ( ( ) ) => ( ) ,
298- DomainGoal :: Reveal ( ( ) ) => ( ) ,
299+ DomainGoal :: Compatible ( ( ) ) | DomainGoal :: Reveal ( ( ) ) => ( ) ,
299300 } ;
300301
301302 Ok ( ( ) )
0 commit comments