// run-rustfix trait Trait {} impl Trait for () {} // this works fn foo() -> impl Trait { () } fn bar() -> impl Trait + std::marker::Sync + Send where T: Send, { () //~ ERROR mismatched types } fn other_bounds() -> impl Trait where T: Trait, Vec: Clone, { () //~ ERROR mismatched types } fn main() { foo(); bar::<()>(); other_bounds::<()>(); }