Closed
Description
Why isn't the Copy trait implemented for the type String?
I tried this code:
#[derive(Copy, Clone)]
enum MyEnum {
abc(String),
}
But i got following error:
error[E0204]: the trait `Copy` cannot be implemented for this type
--> src\test.rs:1:17
|
1 | #[derive(Clone, Copy)]
| ^^^^
...
w | Abc(String),
| ------ this field does not implement `Copy`
|
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)