<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct Foo&lt;T&gt;(T);
struct A;
struct B;

impl Foo&lt;A&gt; {
    fn foo() {}
}
impl Foo&lt;B&gt; {
    fn foo() {}
}

fn main() {}"><pre class="notranslate"><span class="pl-k">struct</span> <span class="pl-smi">Foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-smi">T</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">struct</span> <span class="pl-smi">A</span><span class="pl-kos">;</span>
<span class="pl-k">struct</span> <span class="pl-smi">B</span><span class="pl-kos">;</span>

<span class="pl-k">impl</span> <span class="pl-smi">Foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">impl</span> <span class="pl-smi">Foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">B</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">produces duplicate definition error for <code class="notranslate">foo</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test.rs:9:2: 9:13 error: duplicate definition of value `foo`
test.rs:9       fn foo() {}
                ^~~~~~~~~~~
test.rs:6:2: 6:13 note: first definition of value `foo` here
test.rs:6       fn foo() {}
                ^~~~~~~~~~~
error: aborting due to previous error"><pre class="notranslate"><code class="notranslate">test.rs:9:2: 9:13 error: duplicate definition of value `foo`
test.rs:9       fn foo() {}
                ^~~~~~~~~~~
test.rs:6:2: 6:13 note: first definition of value `foo` here
test.rs:6       fn foo() {}
                ^~~~~~~~~~~
error: aborting due to previous error
</code></pre></div>
<p dir="auto">Since <code class="notranslate">Foo&lt;A&gt;</code> and <code class="notranslate">Foo&lt;B&gt;</code> are different types, it seems that their impls should not be interfering with each other.</p>
<p dir="auto">Currently there is no way to pass arbitrary compiler flags to rustdoc. This means that I can't use rustdoc to check cross compiled libraries. For example, checking <code class="notranslate">i686-unknown-linux-gnu</code> from <code class="notranslate">x86_64-unknown-linux-gnu</code> is impossible because I can't pass <code class="notranslate">--target</code> to rustdoc.</p>
<p dir="auto">I've worked around this issue for now by disabling doctests in Servo, but that is not ideal.</p>