*x == *y
for trait objects produce move error, so it is not equivalent to PartialEq::eq(&*x, &*y)
even though the reference says it is
#127215
Labels
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
A-trait-objects
Area: trait objects, vtable layout
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code produces a move error:
But according to the reference, it should be equivalent to the following, which does work:
It seems to be specific to trait objects; e.g. replacing
Box<dyn Animal>
withBox<[String]>
will make both versions off
compile.Originally reported in #123056 (comment)
The text was updated successfully, but these errors were encountered: