<p dir="auto">At the moment the following code triggers dead code warnings for both f and g. The latter is unnecessary.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fn f(){
   fn g(){};
   g();
}"><pre class="notranslate"><code class="notranslate">fn f(){
   fn g(){};
   g();
}
</code></pre></div>
<p dir="auto">rust version 0.9</p>
<p dir="auto">On reddit: <a href="https://www.reddit.com/r/rust/comments/36f94o/how_do_i_read_the_api_docs/" rel="nofollow">https://www.reddit.com/r/rust/comments/36f94o/how_do_i_read_the_api_docs/</a></p>
<blockquote>
<p dir="auto">I had a terrible time with the API docs. Take <a href="https://doc.rust-lang.org/std/str/" rel="nofollow">str</a>... I know I can use <code class="notranslate">to_string()</code> on it because I saw a web page that said I could, but I can't seem to infer that from the docs. Then I search for <code class="notranslate">to_string()</code> and get <a href="https://doc.rust-lang.org/std/string/trait.ToString.html#tymethod.to_string" rel="nofollow">this page</a>, but it doesn't seem to apply to str types.</p>
</blockquote>
<p dir="auto">What’s going on is that the <code class="notranslate">to_string()</code> method is on the <code class="notranslate">ToString</code> trait which has a blanket impl</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="impl&lt;T&gt; ToString for T where T: Display + ?Sized"><pre class="notranslate"><span class="pl-k">impl</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span> <span class="pl-smi">ToString</span> <span class="pl-k">for</span> <span class="pl-smi">T</span> <span class="pl-k">where</span> <span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-smi">Display</span> + ?<span class="pl-smi">Sized</span><span class="pl-kos"></span></pre></div>
<p dir="auto">… and <code class="notranslate">str</code> implements <code class="notranslate">Display</code>.</p>
<p dir="auto">So in the spirit of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="49725351" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/19190" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/19190/hovercard" href="https://github.com/rust-lang/rust/issues/19190">#19190</a> (show methods available through deref), rustdoc should also show methods available through blanket implementations.</p>