Cannot unify associated type parameter in impl Fn
with concrete instantiation
#73226
Labels
A-associated-items
Area: Associated items such as associated types and consts.
A-lazy-normalization
Area: lazy normalization (tracking issue: #60471)
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi, I'm running into a strange behavior where the compiler has difficulty unifying an associated type in an
impl Fn
with a concrete type in a certain instantiation of it.Link to playpen: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=1d0d2fd109dd2c691f2b2051b8a2d33a
I have also reproduced the code below.
Here is the error output for the portion that doesn't compile:
What is unclear to me is whether this is an intended restriction of the
impl Trait
feature or an unintended compiler issue. I believe specialization imposes some artificial restrictions on unifying specialized associated types with their concrete counterparts as a soundness protection. Is the same happening here?I have also posted this on the users.rust-lang-org forum where it was suggested this is a bug.
Thanks for your help in advance :)
The text was updated successfully, but these errors were encountered: