@@ -181,8 +181,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
181181 return ;
182182 }
183183 }
184- ImpliedBoundsContext :: TyParam ( ..) | ImpliedBoundsContext :: AssociatedTypeOrImplTrait => {
185- }
184+ ImpliedBoundsContext :: TyParam ( ..)
185+ | ImpliedBoundsContext :: AssociatedType ( ..)
186+ | ImpliedBoundsContext :: TraitObject
187+ | ImpliedBoundsContext :: TraitAscription
188+ | ImpliedBoundsContext :: ImplTrait => { }
186189 }
187190 let collected = collect_sizedness_bounds ( tcx, hir_bounds, where_bounds, context, span) ;
188191 if let Some ( span) = collected. sized . maybe . or ( collected. sized . negative )
@@ -195,7 +198,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
195198 add_trait_bound ( tcx, bounds, self_ty, meta_sized_did, span) ;
196199 } else if !collected. any ( ) {
197200 let span = match context {
198- ImpliedBoundsContext :: TyParam ( def) => {
201+ ImpliedBoundsContext :: TraitDef ( def)
202+ | ImpliedBoundsContext :: TyParam ( def)
203+ | ImpliedBoundsContext :: AssociatedType ( def) => {
199204 self . tcx ( ) . with_stable_hashing_context ( |hcx| {
200205 span. mark_with_reason (
201206 None ,
@@ -214,7 +219,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
214219 add_trait_bound ( tcx, bounds, self_ty, meta_sized_did, span) ;
215220 }
216221 ImpliedBoundsContext :: TyParam ( ..)
217- | ImpliedBoundsContext :: AssociatedTypeOrImplTrait => {
222+ | ImpliedBoundsContext :: AssociatedType ( ..)
223+ | ImpliedBoundsContext :: TraitObject
224+ | ImpliedBoundsContext :: TraitAscription
225+ | ImpliedBoundsContext :: ImplTrait => {
218226 // If there are no explicit sizedness bounds on a parameter then add a default
219227 // `Sized` bound.
220228 let sized_did = tcx. require_lang_item ( hir:: LangItem :: Sized , span) ;
0 commit comments