Suggest reborrowing unsized value when borrowed trait object wanted #93596
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-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
The current output is:
Ideally the output would suggest borrowing, since this:
compiles and works just fine.
The problem is that you can't make an object which is a wide pointer directly into a trait object refernce, because it would have to be a triple-sized pointer. But often, you can just reborrow instead.
The text was updated successfully, but these errors were encountered: