title: How do I implement Copy and Clone for a type that contains a String (or any type that doesn't implement Copy)?
body: <p>I have an enum in Rust which has one value that takes a <code>String</code>:</p>
  
  <pre><code>#[derive(Clone, Copy)]
  enum Simple {
      Error(String),
      Okay,
      Foo([u32; 5]),
  }
  
  fn main() {
      let x = Simple::Error(String::from("blah"));
      let y = x.clone();
  }
  </code></pre>
  
  <p>The enum value <code>Foo</code> above represents about 10 other enums I use that take copyable types or arrays of them. The compiler doesn't seem to complain about them, only the <code>Error(String)</code> which causes this:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0204]: the trait `Copy` may not be implemented for this type
   --&gt; src/main.rs:1:17
    |
  1 | #[derive(Clone, Copy)]
    |                 ^^^^
  2 | enum Simple {
  3 |     Error(String),
    |           ------ this field does not implement `Copy`
    |
  </code></pre>
  
  <p>For some reason, <code>String</code> is not copyable. I don't get this. How do I implement <code>Clone</code> for an enum for just the one type which has a problem while using the default impl for the rest?</p>