title: Why is assigning to a member of a pointer still valid after the pointer is moved?
body: <p>Why is <code>n1_mut</code> still valid in this example? It has been moved into <code>Option::Some</code> so shouldn't it be invalid? </p>
  
  <pre><code>struct MyRecordRec2&lt;'a&gt; {
      pub id: u32,
      pub name: &amp;'a str,
      pub next: Box&lt;Option&lt;MyRecordRec2&lt;'a&gt;&gt;&gt;
  }
  
  #[test]
  fn creating_circular_recursive_data_structure() {
      let mut n1_mut = MyRecordRec2 {
          id: 1,
          name: "n1",
          next: Box::new(None)
      };
  
      let n2 = MyRecordRec2 {
          id: 2,
          name: "n2",
          next: Box::new(Some(n1_mut))
      };
  
      //Why is n1_mut still valid?
      n1_mut.next = Box::new(Some(n2));
  }
  </code></pre>
  
  <p>The following does not compile with the familiar "use of moved value"  error:</p>
  
  <pre><code>#[test]
  fn creating_and_freezing_circular_recursive_data_structure() {
      let loop_entry = {
          let mut n1_mut = MyRecordRec2 {
              id: 1,
              name: "n1",
              next: Box::new(None),
          };
  
          let n2 = MyRecordRec2 {
              id: 2,
              name: "n2",
              next: Box::new(Some(n1_mut)),
          };
  
          n1_mut.next = Box::new(Some(n2));
  
          n1_mut
      };
  }
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>error[E0382]: use of moved value: `n1_mut`
    --&gt; src/main.rs:44:9
     |
  39 |             next: Box::new(Some(n1_mut)),
     |                                 ------ value moved here
  ...
  44 |         n1_mut
     |         ^^^^^^ value used here after move
     |
     = note: move occurs because `n1_mut` has type `MyRecordRec2&lt;'_&gt;`, which does not implement the `Copy` trait
  </code></pre>