Diagnostic should explain that 'impl trait' captures generic parameters #68020
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code: playground:
produces the following error:
However, it does not explain where
u8
andString
come from.When emitting a 'mistmatched type' error for two 'impl trait' types with the same
DefId
, we should explain that each set of generic parameters creates a unique opaque type, which is not equivalent to other opaque types generated by the same function.See #66463 (comment) for the original discussion
The text was updated successfully, but these errors were encountered: