error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@repro.rs:16:17: 16:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@repro.rs:18:32: 18:35}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied
--> repro.rs:14:50
|
14 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `chumsky::private::ParserSealed<'_, &str, (), chumsky::extra::Full<EmptyErr, (), ()>>` is not implemented for `Then<Ignored<Filter<..., ...>, ...>, ..., ..., ..., ...>`, which is required by `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@repro.rs:16:17: 16:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@repro.rs:18:32: 18:35}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>`
|
= help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@repro.rs:16:17: 16:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@repro.rs:18:32: 18:35}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>`
= help: for that trait implementation, expected `((), ())`, found `()`
= note: required for `Then<Ignored<Filter<..., ...>, ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>`
note: required for `Then<Ignored<Filter<..., ...>, ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>`
--> repro.rs:12:16
|
12 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {}
| ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here
= note: the full name for the type has been written to '/home/jyn/.local/lib/cargo/target/debug/deps/foo-f0b1a0054d2a8996.long-type-7449552674356047294.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: the full name for the type has been written to '/home/jyn/.local/lib/cargo/target/debug/deps/foo-f0b1a0054d2a8996.long-type-7449552674356047294.txt'
= note: consider using `--verbose` to print the full type name to the console
For more information about this error, try `rustc --explain E0277`.
Code
Current output
Details
Desired output
expected `((), ())`, found `()`should be highlighted instead ofis implemented for `Then<...>`ParserSealed<((), ())>andParserSealed<()>should be highlighted.ws().then()line is related (from the spans, it looks like this is an error at the level of the function signature, not the function implementation)Rationale and extra context
Other cases
No response
Rust Version
rustc 1.84.0-nightly (662180b 2024-10-20)
binary: rustc
commit-hash: 662180b
commit-date: 2024-10-20
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.1
Anything else?
No response