// Test that we don't ICE for a typeck error that only shows up in dropck // issue #135039 //@ edition:2018 pub trait AuthUser { type Id; } pub trait AuthnBackend { type User: AuthUser; } pub struct AuthSession { user: Option, data: Option<<::User as AuthUser>::Id>, } pub trait Authz: Sized { type AuthnBackend: AuthnBackend; } pub trait Query { type Output; async fn run(&self) -> Result; } pub async fn run_query + 'static>( auth: AuthSession, //~^ ERROR the trait bound `User: AuthUser` is not satisfied [E0277] //~| ERROR the trait bound `User: AuthUser` is not satisfied [E0277] query: Q, ) -> Result { let user = auth.user; query.run().await } fn main() {}