as
cast of non-Copy
enum is no longer a move
#102389
Labels
C-bug
Category: This is a bug.
P-critical
Critical priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
@MinusKelvin noticed this 1.63→1.64 change in #102303 (comment)
I tried this code:
I expected to see this happen: because
Enum
is non-Copy
, an error about moving out from behind a reference, like happened in 1.63 https://rust.godbolt.org/z/vGPqbsE6vInstead, this happened: it compiles fine in 1.64 https://rust.godbolt.org/z/svsPMxTs8 and in nightly https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=817f19e95903785423743c2a8466c189
This is probably cased by
Change enum->int casts to not go through MIR casts #96862
which is mentioned in https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1640-2022-09-22
It's unclear to me whether this is intentional under the banner of "
Drop
behaviour", since there's noDrop
trait involved.The text was updated successfully, but these errors were encountered: