-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Unable to deduce associated type equality #47897
Copy link
Copy link
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-langRelevant to the language teamRelevant to the language team
Description
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-langRelevant to the language teamRelevant to the language team
I'm working with combine and rust nightly to make some parsers and I'm wondering why both of these examples are not equivalent:
The first example compiles successfully:
whereas this one
produces this error:
AFAICT, the bounds:
I::Error: ParseError<u8, &'a [u8], I::Position>andI::Error: ParseError<I::Item, I::Range, I::Position>should be identical since we knowI::Item = u8andI::Range = &'a [u8].Is this a limitation of the compiler's inference, a bug, or something else?