Closed
Description
What makes the clone_token
function in this code example illegal? https://play.rust-lang.org/?gist=f284d059d2ec79b770e887654c402be3&version=nightly
It certainly feels like it ought to be illegal.
But it's not violating any of the usual rules: it's not a data race, the objects sizes match, the alignment requirements are met, it produces an object containing a valid bit pattern for the type, it meets all the lifetime and mutability requirements, ...
Is there a rule I forgot?
Metadata
Metadata
Assignees
Labels
No labels