//@ known-bug: #119095 //@ compile-flags: --edition=2021 fn any() -> T { loop {} } trait Acquire { type Connection; } impl Acquire for &'static () { type Connection = (); } trait Unit {} impl Unit for () {} fn get_connection() -> impl Unit where T: Acquire, T::Connection: Unit, { any::() } fn main() { let future = async { async { get_connection::<&'static ()>() }.await }; future.resolve_me(); } trait ResolveMe { fn resolve_me(self); } impl ResolveMe for S where (): CheckSend, { fn resolve_me(self) {} } trait CheckSend {} impl CheckSend for () where F: Send {} trait NeverImplemented {} impl CheckSend for E where E: NeverImplemented {}