seq!
for tuples errors when capturing locally-defined parsers.
#502
Labels
A-combinator
Area: combinators
C-bug
Category: Things not working as expected
M-breaking-change
Meta: Implementing or merging this will introduce a breaking change.
Milestone
Please complete the following tasks
rust version
rustc 1.77.0 (aedd173a2 2024-03-17)
winnow version
0.6.5
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo check
Actual Behaviour
Expected Behaviour
This should compile.
If
seq!
is used to make a struct (instead of a tuple) it does compile.works fine.
Additional Context
Manually expanding the
seq!
macro (with RA) for the broken example gives:This gives a more descriptive error:
Manually expanding the example that does work gives:
I think the reason this works is that
foo
andbar
don't need to be captured by value here, as.parse_next
takes&mut self
.Adding
.by_ref()
to the tuple example version may fix it.The text was updated successfully, but these errors were encountered: