//@ revisions: compat no-compat //@[no-compat] compile-flags: -Zno-implied-bounds-compat #![allow(unreachable_code, unused)] use std::marker::PhantomData; struct FsmBuilder { _fsm: PhantomData, } impl FsmBuilder { fn state(&mut self) -> FsmStateBuilder { todo!() } } struct FsmStateBuilder { _state: PhantomData, } impl FsmStateBuilder { fn on_entry)>(&self, _action: TAction) {} } trait Fsm { type Context; } struct StateContext<'a, TFsm: Fsm> { context: &'a mut TFsm::Context, } fn main() { let mut builder: FsmBuilder = todo!(); builder.state().on_entry(|_| {}); //~^ ERROR the trait bound `usize: Fsm` is not satisfied }