Closed matthiaskrgr closed 2 years ago
Hmm... this will be fun to minimize, lol.
Ok this is due to #100096. I'll probably revert that due to its existing perf regression and this ICE. I may also work on a test, but it might be hard to minimize. I'll see.
searched nightlies: from nightly-2022-06-01 to nightly-2022-09-25 regressed nightly: nightly-2022-09-22 searched commit range: https://github.com/rust-lang/rust/compare/432abd86f231c908f6df3cdd779e83f35084be90...9062b780b32d2eab060b4432863e085d9504ca5c regressed commit: https://github.com/rust-lang/rust/commit/1de00d1ac5247a02184ef7ad044f6521ade7e0cc
95 line minimisation. It's probably possible to go smaller, but I can't figure out how
down to ~50 lines
pub(crate) trait Parser: Sized {
type Output;
fn parse(&mut self, _input: &str) -> Result<(), ()> {
loop {}
}
fn map<F, B>(self, _f: F) -> Map<Self, F>
where
F: FnMut(Self::Output) -> B,
{
todo!()
}
}
pub(crate) struct Chainl1<P, Op>(P, Op);
impl<P, Op> Parser for Chainl1<P, Op>
where
P: Parser,
Op: Parser,
Op::Output: FnOnce(P::Output, P::Output) -> P::Output,
{
type Output = P::Output;
}
pub(crate) fn chainl1<P, Op>(_parser: P, _op: Op) -> Chainl1<P, Op>
where
P: Parser,
Op: Parser,
Op::Output: FnOnce(P::Output, P::Output) -> P::Output,
{
loop {}
}
pub(crate) struct Map<P, F>(P, F);
impl<A, B, P, F> Parser for Map<P, F>
where
P: Parser<Output = A>,
F: FnMut(A) -> B,
{
type Output = B;
}
impl Parser for u32 {
type Output = ();
}
pub fn chainl1_error_consume() {
fn first<T, U>(t: T, _: U) -> T {
t
}
let _ = chainl1(1, 1.map(|_| first)).parse("");
}
Code
This happens inside https://github.com/Marwes/combine The ice seems to come from this test function https://github.com/Marwes/combine/blob/master/src/lib.rs#L637
Meta
rustc --version --verbose
:Error output
Backtrace
```
```