<p dir="auto">E.g.,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="trait T {
    fn foo(&amp;self) {}
}

impl&lt;'a&gt; T+'a {
    fn foo(&amp;self) {}
}"><pre class="notranslate"><code class="notranslate">trait T {
    fn foo(&amp;self) {}
}

impl&lt;'a&gt; T+'a {
    fn foo(&amp;self) {}
}
</code></pre></div>
<p dir="auto">Should be OK. (It currently gives "duplicate definition of value <code class="notranslate">foo</code>").</p>
<p dir="auto">Follow up to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="44836847" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/17750" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/17750/hovercard" href="https://github.com/rust-lang/rust/issues/17750">#17750</a></p>
<h3 dir="auto">STR</h3>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![crate_type = &quot;lib&quot;]

pub trait Bound&lt;T&gt; {}
pub trait Trait: Bound&lt;i8&gt; + Bound&lt;u8&gt; {}
//~^ error: trait `Bound&lt;u8&gt;` already appears in the list of bounds
fn foo&lt;T: Bound&lt;i8&gt; + Bound&lt;u8&gt;&gt;() {}
//~^ error: trait `Bound&lt;u8&gt;` already appears in the list of bounds
fn foo&lt;T&gt;() where T: Bound&lt;i8&gt; + Bound&lt;u8&gt; {}  // OK"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>crate_type = <span class="pl-s">"lib"</span><span class="pl-kos">]</span></span>

<span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">Bound</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-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">Trait</span><span class="pl-kos">:</span> <span class="pl-smi">Bound</span><span class="pl-kos">&lt;</span><span class="pl-smi">i8</span><span class="pl-kos">&gt;</span> + <span class="pl-smi">Bound</span><span class="pl-kos">&lt;</span><span class="pl-smi">u8</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-c">//~^ error: trait `Bound&lt;u8&gt;` already appears in the list of bounds</span>
<span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-smi">Bound</span><span class="pl-kos">&lt;</span><span class="pl-smi">i8</span><span class="pl-kos">&gt;</span> + <span class="pl-smi">Bound</span><span class="pl-kos">&lt;</span><span class="pl-smi">u8</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-c">//~^ error: trait `Bound&lt;u8&gt;` already appears in the list of bounds</span>
<span class="pl-k">fn</span> <span class="pl-en">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-kos">)</span> <span class="pl-k">where</span> <span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-smi">Bound</span><span class="pl-kos">&lt;</span><span class="pl-smi">i8</span><span class="pl-kos">&gt;</span> + <span class="pl-smi">Bound</span><span class="pl-kos">&lt;</span><span class="pl-smi">u8</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>  <span class="pl-c">// OK</span></pre></div>
<p dir="auto">Due to multidispatch <code class="notranslate">: Bound&lt;i8&gt; + Bound&lt;u8&gt;</code> is a valid bound, but the compiler is rejecting it in some positions (supertraits and bounds in parameter list), but not in others (where clauses)</p>
<h3 dir="auto">Workaround for the supertrait</h3>
<p dir="auto">You can use dummy intermediate traits to indirectly add the "duplicate" bounds, but this is very verbose.</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pub trait Bound&lt;T&gt; {}
pub trait Dummy: Bound&lt;i8&gt; {}
pub trait Trait: Dummy + Bound&lt;u8&gt; {}  // `Trait` implies `Bound&lt;i8&gt; + Bound&lt;u8&gt;`"><pre class="notranslate"><span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">Bound</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-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">Dummy</span><span class="pl-kos">:</span> <span class="pl-smi">Bound</span><span class="pl-kos">&lt;</span><span class="pl-smi">i8</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">Trait</span><span class="pl-kos">:</span> <span class="pl-smi">Dummy</span> + <span class="pl-smi">Bound</span><span class="pl-kos">&lt;</span><span class="pl-smi">u8</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>  <span class="pl-c">// `Trait` implies `Bound&lt;i8&gt; + Bound&lt;u8&gt;`</span></pre></div>
<h3 dir="auto">Version</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.0.0-nightly (3ef8ff1f8 2015-02-12 00:38:24 +0000)"><pre class="notranslate"><code class="notranslate">rustc 1.0.0-nightly (3ef8ff1f8 2015-02-12 00:38:24 +0000)
</code></pre></div>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nikomatsakis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nikomatsakis">@nikomatsakis</a></p>
<p dir="auto">Originally reported in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="47964806" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/18693" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/18693/hovercard" href="https://github.com/rust-lang/rust/issues/18693">#18693</a> (Niko preferred opening a new issue, instead of re-opening the old one and modifying the original report)</p>