Higher-Rank Trait Bounds: incorrect (or misleading) diagnostic #92281
Labels
A-closures
Area: Closures (`|…| { … }`)
A-diagnostics
Area: Messages for errors, warnings, and lints
A-higher-ranked
Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
A-lifetimes
Area: Lifetimes / regions
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=5c03cd34558f9bc8662eac3ff255190e
The current output is:
Note the following lines specially:
where the expected and the found types are the same. I'm not sure if this is a compiler bug because I'm not very familiar
with HRTBs, but the diagnostic could be better. I can't really propose the better diagnostic because I don't know what's wrong
with my code.
The error is the same on nightly and beta.
(Edit: simplified the code a bit)
The text was updated successfully, but these errors were encountered: