Type annotations needed for type alias that refers to associated type on trait #105680
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-inference
Area: Type inference
A-traits
Area: Trait system
C-discussion
Category: Discussion or questions that doesn't represent real issues.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
Playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=97b88d916216f04a93c1d24ca2a4f558
I expected to see this happen: It compiles without issues.
Instead, this happened:
Unless I am missing something, the type of
Impl::Bar
is defined unambiguously to beFoo<String>
. It works once you add the type annotation:Meta
The problem is reproducible for stable, beta and nightly (tried in playground).
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: