IATs: Decide if we want to hard-error on inherent projections if the path in question may just as well refer to an enum variant #142023
Labels
A-type-system
Area: Type system
C-discussion
Category: Discussion or questions that doesn't represent real issues.
F-inherent_associated_types
`#![feature(inherent_associated_types)]`
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
For forward compatibility with hypothetical (enum) variant types, we currently reject trait associated type projections if the path in question may just as well refer to enum variants. By "reject" I mean we issue the deny-by-default lint
ambiguous_associated_items
(#57644) for backward compatibility:For the IAT analogue, we currently don't emit this lint / any error:
The question is: Should we?
Note that for trait associated type paths, we have syntax to disambiguate them: Fully-qualified paths:
<$Type as $Trait>::$PathSeg
while for inherent associated type paths there's none.(There's the obvious question of whether we will ever actually support some form of variant types or if pattern types will supersede them but that's a T-lang question I guess and therefore we should probably better be safe than sorry and just hard-reject these cases as ambiguous.)
The text was updated successfully, but these errors were encountered: