It seems that if I try to derive both Copy and Trace in a simple structure, I get this error:
The Copy trait was implemented on a type with a Drop implementation.
Erroneous code example:
#[derive(Copy)]
struct Foo; // error!
impl Drop for Foo {
fn drop(&mut self) {
}
}
Explicitly implementing both Drop and Copy trait on a type is currently
disallowed. This feature can make some sense in theory, but the current
implementation is incorrect and can lead to memory unsafety (see
issue #20126), so it has been disabled for now.
But from my understanding, a simple Copy structure such as:
#[derive(Debug, Clone, Copy, Trace)]
struct Sym(usize);
should be easy to implement, and the Trace implementation could be empty, right? Is there a proper way to do this? It's currently blocking doing type-safe string interning in Boa.
It seems that if I try to derive both
CopyandTracein a simple structure, I get this error:But from my understanding, a simple
Copystructure such as:should be easy to implement, and the
Traceimplementation could be empty, right? Is there a proper way to do this? It's currently blocking doing type-safe string interning in Boa.