Bogus T:Sized suggestion when using size_of::<T> as a const #69228
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
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.
Example:
playground
Results in the following error:
of course,
T
isSized
by default unless you sayT: ?Sized
, so the error and the suggestion are clearly wrong. And if you do sayT: Sized
explicitly,you get
Note
T: std::marker::Sized +
being suggested, which isnot even valid syntaxapparently valid syntax, but not something you would write.I expected to see this happen:
Meta
rustc --version --verbose
:(Seems to happen on nightly too.)
The text was updated successfully, but these errors were encountered: