// This should not pass, because `usize: Fsm` does not hold. However, it currently ICEs. // ignore-tidy-linelength // revisions: compat no-compat //[compat] check-pass //[no-compat] compile-flags: -Zno-implied-bounds-compat //[no-compat] check-fail //[no-compat] known-bug: #80409 //[no-compat] failure-status: 101 //[no-compat] normalize-stderr-test "note: .*\n\n" -> "" //[no-compat] normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" //[no-compat] normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: " //[no-compat] rustc-env:RUST_BACKTRACE=0 #![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(|_| {}); }