<p dir="auto">Long pages such as in <a href="http://doc.rust-lang.org/regex/regex/index.html" rel="nofollow">regex</a> have many examples but it's difficult to know at a glance what the documentation contains without scanning the entire document. Having a table of contents would help a lot with this.</p>
<p dir="auto">Here is a list of links to different TOC styles from various places for ways it could be done:</p>
<ul dir="auto">
<li><a href="https://docs.python.org/2/tutorial/introduction.html" rel="nofollow">Python 2.7</a> has one in the sidebar. Stays with you as you scroll.</li>
<li><a href="https://docs.python.org/3.5/tutorial/introduction.html" rel="nofollow">Python 3.5</a> seems to be slightly cleaner but similar. Doesn't stay with you.</li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions" rel="nofollow">mozilla javascript docs</a>: is nicely in the sidebar. Follows you down the page (requires the window to be wide enough).</li>
<li><a href="https://en.wikipedia.org/wiki/Cat" rel="nofollow">wikipedia</a>: in the middle of the page. Doesn't scroll with you.</li>
<li><a href="http://rustbyexample.com/" rel="nofollow">gitbook</a>: stays with you. provides scrolling.</li>
<li><a href="http://perldoc.perl.org/perl.html" rel="nofollow">perl</a>: looks like it's formatted like a man page.</li>
</ul>
<p dir="auto">I looked for some more but didn't find other good examples.</p>
<p dir="auto">Of these, I like the mozilla, python 2, and gitbook TOCs best with the mozilla probably the best among them (probably because it's small and clean). However, I think the gitbook style is probably the most appropriate fit to the std libs style.</p>
<p dir="auto">I've also provided a mockups of what a TOC could look like in that style which is similar to a <a href="https://internals.rust-lang.org/t/rustdoc-mockup-for-including-more-structured-content/2540" rel="nofollow">different thread</a>. Clearly, something would need to be done with the current sidebar to use this format.</p>
<p dir="auto">Mockup:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/4156987/9537217/e8e5fac2-4d03-11e5-9015-64ca37e752f1.png"><img src="https://cloud.githubusercontent.com/assets/4156987/9537217/e8e5fac2-4d03-11e5-9015-64ca37e752f1.png" alt="toc" style="max-width: 100%;"></a></p>
<p dir="auto">Here's a minimal code example that reproduces the error:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![crate_name = &quot;test&quot;]
#![crate_type = &quot;dylib&quot;]

use std::ops::Div;

pub struct Test
{
    pub test:i32,
}

impl Div&lt;Test,Test&gt; for Test { fn div( &amp;self, v:&amp;Test ) -&gt; Test { Test{ test:self.test / v.test } } }"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>crate_name = <span class="pl-s">"test"</span><span class="pl-kos">]</span></span>
<span class="pl-c1">#!<span class="pl-kos">[</span>crate_type = <span class="pl-s">"dylib"</span><span class="pl-kos">]</span></span>

<span class="pl-k">use</span> std<span class="pl-kos">::</span>ops<span class="pl-kos">::</span><span class="pl-v">Div</span><span class="pl-kos">;</span>

<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">Test</span>
<span class="pl-kos">{</span>
    <span class="pl-k">pub</span> <span class="pl-c1">test</span><span class="pl-kos">:</span><span class="pl-smi">i32</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>

<span class="pl-k">impl</span> <span class="pl-smi">Div</span><span class="pl-kos">&lt;</span><span class="pl-smi">Test</span><span class="pl-kos">,</span><span class="pl-smi">Test</span><span class="pl-kos">&gt;</span> <span class="pl-k">for</span> <span class="pl-smi">Test</span> <span class="pl-kos">{</span> <span class="pl-k">fn</span> <span class="pl-en">div</span><span class="pl-kos">(</span> <span class="pl-c1">&amp;</span><span class="pl-smi">self</span><span class="pl-kos">,</span> <span class="pl-s1">v</span><span class="pl-kos">:</span><span class="pl-c1">&amp;</span><span class="pl-smi">Test</span> <span class="pl-kos">)</span> -&gt; <span class="pl-smi">Test</span> <span class="pl-kos">{</span> <span class="pl-smi">Test</span><span class="pl-kos">{</span> <span class="pl-c1">test</span><span class="pl-kos">:</span><span class="pl-smi">self</span><span class="pl-kos">.</span><span class="pl-c1">test</span> / v<span class="pl-kos">.</span><span class="pl-c1">test</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div>
<p dir="auto">And part of the error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="note: D:\#dev\#compilers\Rust\bin\rustlib\i686-pc-windows-gnu\lib\libcore-4e7c5e5c.rlib(core-4e7c5e5c.o):(.text+0x6b9b): undefined reference to `rust_begin_unwind'"><pre class="notranslate"><code class="notranslate">note: D:\#dev\#compilers\Rust\bin\rustlib\i686-pc-windows-gnu\lib\libcore-4e7c5e5c.rlib(core-4e7c5e5c.o):(.text+0x6b9b): undefined reference to `rust_begin_unwind'
</code></pre></div>
<p dir="auto">Version:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 0.13.0-nightly (45cbdec41 2014-11-07 00:02:18 +0000)
binary: rustc
commit-hash: 45cbdec4174778bf915f17561ef971c068a7fcbc
commit-date: 2014-11-07 00:02:18 +0000
host: i686-pc-windows-gnu
release: 0.13.0-nightly"><pre class="notranslate"><code class="notranslate">rustc 0.13.0-nightly (45cbdec41 2014-11-07 00:02:18 +0000)
binary: rustc
commit-hash: 45cbdec4174778bf915f17561ef971c068a7fcbc
commit-date: 2014-11-07 00:02:18 +0000
host: i686-pc-windows-gnu
release: 0.13.0-nightly
</code></pre></div>
<p dir="auto">This also happens on the x86_64 nightly</p>