You can probably get away with just:

`if trait_def.bounds.contains_element(ty::BoundSized) { ... }`