V2 seems to accept *&x as valid for a type without copy by turning it into a move x.
Splitting up the test to avoid the other error and generate code shows that is what is happening.
This shouldn't happen. I can't quite think of an attack based on this, but it seems very, very unexpected behavior to move data through an immutable ref.
🐛 Bug
Compare test outputs:
V2 seems to accept
*&x
as valid for a type withoutcopy
by turning it into amove x
.Splitting up the test to avoid the other error and generate code shows that is what is happening.
This shouldn't happen. I can't quite think of an attack based on this, but it seems very, very unexpected behavior to move data through an immutable ref.