From 10934a4c2fa004f2125957670fb7bea5492d256f Mon Sep 17 00:00:00 2001 From: Jojakim Stahl Date: Sun, 2 Feb 2025 22:12:53 +0100 Subject: [PATCH] Fix NONCONSUMPTION_IS_OK for Flatten --- src/combinator.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/combinator.rs b/src/combinator.rs index 82c1ddaa..e1d80f4e 100644 --- a/src/combinator.rs +++ b/src/combinator.rs @@ -2187,7 +2187,10 @@ where { type IterState = (A::IterState, Option>); - const NONCONSUMPTION_IS_OK: bool = A::NONCONSUMPTION_IS_OK; + // A::NONCONSUMPTION_IS_OK cannot be used because if we are iterating + // over O, we are not consuming any input (input has probably + // already been comsumed when constructing O) + const NONCONSUMPTION_IS_OK: bool = true; #[inline(always)] fn make_iter(