Detect when if/else is tail expression has mismatched types that could be a boxed trait #69107
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following
we currently emit
We should suggest changing the return type from
impl Trait
toBox<dyn Trait>
and boxing the two branches. I think this is the last missing suggestion we can give involdingimpl Trait
anddyn Trait
returns.Follow up to #68110.
The text was updated successfully, but these errors were encountered: