title: Understanding the Debug implementation for Vec<T>
body: <p>Trying to implement the <code>Debug</code> trait for a custom type I stumbled upon the implementation for <code>Vec&lt;T&gt;</code>. I have difficulties understanding how it works. </p>
  
  <p>The implementation goes like this:</p>
  
  <pre><code>impl&lt;T: fmt::Debug&gt; fmt::Debug for Vec&lt;T&gt; {
      fn fmt(&amp;self, f: &amp;mut fmt::Formatter) -&gt; fmt::Result {
          fmt::Debug::fmt(&amp;**self, f)
      }
  }
  </code></pre>
  
  <p>I understand it calls the <code>fmt</code> implementation for some other type. What I cannot understand is what type it is. I've tried to figure it out with the help of <a href="https://stackoverflow.com/questions/28519997/what-are-rusts-exact-auto-dereferencing-rules">another question</a>, and searching among the <a href="http://file:///home/toro2k/stuff/opt/rust/share/doc/rust/html/std/fmt/trait.Debug.html" rel="nofollow noreferrer">implementations of <code>Debug</code></a> for something that looks appropriate (maybe something like <code>&amp;[T]</code>), but with no success.</p>
  
  <p>What is the exact meaning of <code>&amp;**self</code> in this context? What implementation of <code>Debug</code> is being called?</p>