title: Should simple enums derive Copy? Is there any difference in performance?
body: <pre><code>use std::collections::HashMap;
  
  // #[derive(Copy, Clone)]
  enum SomeEnum {
      Some1,
      Some2,
  }
  
  struct SomeStruct {
      pub some_enum: SomeEnum,
      pub s: String,
  }
  
  fn proc_struct(some_struct: &amp;SomeStruct) {
      let mut map = HashMap::new();
      map.insert(String::from("any"), 0);
  
      match map.get(&amp;some_struct.s) { // just to make a reference in SomeStruct
          Some(v) =&gt; {
              proc1(some_struct.some_enum);
              proc2(&amp;some_struct.some_enum);
          }
          None =&gt; {}
      }
  }
  
  fn proc1(some: SomeEnum) {}
  
  fn proc2(some: &amp;SomeEnum) {}
  
  fn main() {
      let some_struct = SomeStruct { some_enum: SomeEnum::Some1, s: String::from("s") };
  
      proc_struct(&amp;some_struct);
  }
  </code></pre>
  
  <p>The above code produces the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0507]: cannot move out of borrowed content
    --&gt; src/main.rs:20:19
     |
  20 |             proc1(some_struct.some_enum);
     |                   ^^^^^^^^^^^ cannot move out of borrowed content
  </code></pre>
  
  <p>When I add <code>#[derive(Copy, Clone)]</code> to <code>SomeEnum</code>, it compiles fine.</p>
  
  <p>Should simple enums like <code>SomeEnum</code> derive the <code>Copy</code> trait?
  Is there any difference in performance between functions <code>proc1()</code> and <code>proc2()</code>?</p>