// revisions: check build // [check]check-pass // // This second configuration aims to verify that we do not ICE in ConstProp because of // normalization failure. // [build]build-pass // [build]compile-flags: -Zmir-opt-level=3 --emit=mir #![allow(dead_code)] trait ParseError { type StreamError; } impl ParseError for T { type StreamError = (); } trait Stream { type Item; type Error: ParseError; } trait Parser where ::PartialState: Default, { type PartialState; fn parse_mode(_: &Self, _: Self::PartialState) { loop {} } } impl Stream for () { type Item = (); type Error = (); } impl Parser for () { type PartialState = (); } struct AndThen(core::marker::PhantomData<(A, B)>); impl Parser for AndThen where A: Stream, B: Into<::StreamError>, { type PartialState = (); } fn expr() -> impl Parser where A: Stream::Item>, { AndThen::(core::marker::PhantomData) } fn parse_mode_impl() where ::Error: ParseError, A: Stream::Item>, { Parser::parse_mode(&expr::(), Default::default()) } fn main() {}