Unsizing coercions apply in an inconvenient order with respect to constructor calls. #89299
Labels
A-coercions
Area: implicit and explicit `expr as Type` coercions
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
It looks like it's trying to coerce the
i32
todyn Trait + Send
before constructing thePin
rather than constructing thePin<&mut i32>
and then coercing that toPin<&mut (dyn Trait + Send)>
. You can fix this by constructing thePin
in a separate statement, but ideally the compiler would defer the unsizing coercion:The text was updated successfully, but these errors were encountered: