title: Implicit conversion to static lifetime in anyhow::Error
body: <p>I was reading up code for <code>anyhow</code> crate in Rust. There is a <a href="https://github.com/dtolnay/anyhow/blob/5a193636c3ebaec353bba13d62feeeb55d86f77a/src/error.rs#L76" rel="nofollow noreferrer">particular line</a> I don't fully grasp:</p>
  <pre><code>{
   let vtable = &amp;ErrorVTable { ... };
   construct(vtable, ...);
  }
  
  fn construct(vtable: &amp;'static ErrorVTable, ...);
  </code></pre>
  <p>We seem to create an <code>ErrorVTable</code> struct, and return a reference to it which has lifetime `static. I'd expect compiler to create a struct on function stack, and return a reference to it, causing weird memory issues.</p>
  <p>But it appears like compiler detects that this variable for all possible <code>E</code> inferred on compile time and somehow creates static variables for them? How does this actually work?</p>