Open BLucky-gh opened 5 months ago
Oh it got destabilized again, yeah in that case I guess we just gotta wait until the feature is stable before this can be fixed
Would the todo
parser help?
while it reaches the same conclusion (aka panic), 1) the parser's name in the code implies that branch is unfinished rather than unreachable, 2) it has a different panic message
Please complete the following tasks
rust version
rustc 1.78.0 (9b00956e5 2024-04-29)
winnow version
0.6.13
Minimal reproducible code
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=92bbd4c2222748d4082d828411b9ff61
Steps to reproduce the bug with the above code
just try to compile the code. Either through
cargo run
orbuild
orcheck
Actual Behaviour
the macro tries to expand it to
unreachable!().parse_next(...)
which causes the following error:Expected Behaviour
The macro should try to ignore unreachable expressions, or maybe include a blanket implementation of
Parser
for!
that is justunreachable!()
or evenunreachable_unchecked()
for all required methods as a stopgap measure just to satisfy the compiler?Additional Context
The compiler should realistically be able to detect that the "method" on
!
will never be called, but since it doesn't I guess the library would need to handle itfor now I'll just do a
_ => empty.map(|_| unreachable!())