title: Wouldnt ManuallyDrop without drop call cause memory leak?
body: <p>I am going through <code>wasm-bindgen</code> guide and i came across the <a href="https://rustwasm.github.io/docs/wasm-bindgen/contributing/design/js-objects-in-rust.html" rel="nofollow noreferrer">glue code</a> it generates for interacting between <code>js</code> and <code>rust</code>. A reference to a value is passed from js to rust. Rust has to wrap it in <code>ManuallyDrop</code> so that it wont call the <code>Drop</code> implemented on <code>JsValue</code>.</p>
  <pre><code>pub fn foo(a: &amp;JsValue) {
      // ...
  }
  
  #[export_name = &quot;foo&quot;]
  pub extern &quot;C&quot; fn __wasm_bindgen_generated_foo(arg0: u32) {
      let arg0 = unsafe {
          ManuallyDrop::new(JsValue::__from_idx(arg0))
      };
      let arg0 = &amp;*arg0;
      foo(arg0);
  }
  </code></pre>
  <p>But I do not see a <code>ManuallyDrop::drop</code> being called on <code>arg0</code> . So would the <code>JsValue</code>wrapped in <code>ManuallyDrop</code> be dropped unless the <code>ManuallyDrop::drop(arg0)</code> function is called? Wouldnt it cause a memory leak?</p>