@@ -241,6 +241,27 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
241
241
. intern ( Interner ) ,
242
242
) ,
243
243
} ) ;
244
+ let mut binder = vec ! [ ] ;
245
+ binder. push ( crate :: wrap_empty_binders ( impl_bound) ) ;
246
+ let sized_trait = self
247
+ . db
248
+ . lang_item ( self . krate , SmolStr :: new_inline ( "sized" ) )
249
+ . and_then ( |item| item. as_trait ( ) ) ;
250
+ if let Some ( sized_trait_) = sized_trait {
251
+ let sized_bound = WhereClause :: Implemented ( TraitRef {
252
+ trait_id : to_chalk_trait_id ( sized_trait_) ,
253
+ // Self type as the first parameter.
254
+ substitution : Substitution :: from1 (
255
+ Interner ,
256
+ TyKind :: BoundVar ( BoundVar {
257
+ debruijn : DebruijnIndex :: INNERMOST ,
258
+ index : 0 ,
259
+ } )
260
+ . intern ( Interner ) ,
261
+ ) ,
262
+ } ) ;
263
+ binder. push ( crate :: wrap_empty_binders ( sized_bound) ) ;
264
+ }
244
265
let proj_bound = WhereClause :: AliasEq ( AliasEq {
245
266
alias : AliasTy :: Projection ( ProjectionTy {
246
267
associated_ty_id : to_assoc_type_id ( future_output) ,
@@ -255,11 +276,9 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
255
276
ty : TyKind :: BoundVar ( BoundVar { debruijn : DebruijnIndex :: ONE , index : 0 } )
256
277
. intern ( Interner ) ,
257
278
} ) ;
279
+ binder. push ( crate :: wrap_empty_binders ( proj_bound) ) ;
258
280
let bound = OpaqueTyDatumBound {
259
- bounds : make_single_type_binders ( vec ! [
260
- crate :: wrap_empty_binders( impl_bound) ,
261
- crate :: wrap_empty_binders( proj_bound) ,
262
- ] ) ,
281
+ bounds : make_single_type_binders ( binder) ,
263
282
where_clauses : chalk_ir:: Binders :: empty ( Interner , vec ! [ ] ) ,
264
283
} ;
265
284
// The opaque type has 1 parameter.
0 commit comments