Incorrect diagnostics while referencing supertrait associated const #72190
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: an error that would help me write the correct code.
Instead, this happened: rustc tells me to duplicate the supertrait bound:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a60b4876d5d432ebe824d2dbfa93830d
This happens on both stable and nightly.
(I think it should potentially suggest
<Self as SuperTrait>::Size
in this case, but that doesn't seem to work either, see #72192.)The text was updated successfully, but these errors were encountered: