<p dir="auto">In,</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait BitIter {
    type Iter: Iterator&lt;Item=bool&gt;;
    pub fn bit_iter(self) -&gt; &lt;Self as BitIter&gt;::Iter;
}

pub fn test_bad&lt;Sym: BitIter&gt;(sym: Sym) {
    let i = sym.bit_iter();
}

pub fn test_good&lt;Sym: BitIter&gt;(sym: Sym)
    where &lt;Sym as BitIter&gt;::Iter: Iterator&lt;Item=bool&gt; {
    let i = sym.bit_iter();
}

pub fn main() {}"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">BitIter</span> <span class="pl-kos">{</span>
    <span class="pl-k">type</span> <span class="pl-smi">Iter</span><span class="pl-kos">:</span> <span class="pl-smi">Iterator</span><span class="pl-kos">&lt;</span><span class="pl-smi">Item</span>=<span class="pl-smi">bool</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>
    <span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">bit_iter</span><span class="pl-kos">(</span><span class="pl-smi">self</span><span class="pl-kos">)</span> -&gt; &lt;<span class="pl-smi">Self</span> <span class="pl-k">as</span> <span class="pl-smi">BitIter</span>&gt;<span class="pl-kos">::</span><span class="pl-smi">Iter</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">test_bad</span><span class="pl-kos">&lt;</span><span class="pl-smi">Sym</span><span class="pl-kos">:</span> <span class="pl-smi">BitIter</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">sym</span><span class="pl-kos">:</span> <span class="pl-smi">Sym</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> i = sym<span class="pl-kos">.</span><span class="pl-en">bit_iter</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">pub</span> <span class="pl-k">fn</span> <span class="pl-en">test_good</span><span class="pl-kos">&lt;</span><span class="pl-smi">Sym</span><span class="pl-kos">:</span> <span class="pl-smi">BitIter</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">sym</span><span class="pl-kos">:</span> <span class="pl-smi">Sym</span><span class="pl-kos">)</span>
    <span class="pl-k">where</span> &lt;<span class="pl-smi">Sym</span> <span class="pl-k">as</span> <span class="pl-smi">BitIter</span>&gt;<span class="pl-kos">::</span><span class="pl-smi">Iter</span><span class="pl-kos">:</span> <span class="pl-smi">Iterator</span><span class="pl-kos">&lt;</span><span class="pl-smi">Item</span>=<span class="pl-smi">bool</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> i = sym<span class="pl-kos">.</span><span class="pl-en">bit_iter</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">pub</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"><code class="notranslate">test_bad</code> fails to compile, despite the bounds on <code class="notranslate">BitIter::Iter</code> with,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="hi.rs:7:17: 7:27 error: type mismatch resolving `&lt;&lt;Sym as BitIter&gt;::Iter as core::iter::Iterator&gt;::Item == bool`: expected associated type, found bool
hi.rs:7     let i = sym.bit_iter();
                        ^~~~~~~~~~"><pre class="notranslate"><code class="notranslate">hi.rs:7:17: 7:27 error: type mismatch resolving `&lt;&lt;Sym as BitIter&gt;::Iter as core::iter::Iterator&gt;::Item == bool`: expected associated type, found bool
hi.rs:7     let i = sym.bit_iter();
                        ^~~~~~~~~~
</code></pre></div>
<p dir="auto">Take this code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait Foo { type Value: 'static; }

fn require_static&lt;T: 'static&gt;() {}

fn takes_foo&lt;F: Foo&gt;() {
  require_static::&lt;F::Value&gt;()
}"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span> <span class="pl-k">type</span> <span class="pl-smi">Value</span><span class="pl-kos">:</span> <span class="pl-c1">'</span><span class="pl-ent">static</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">require_static</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-c1">'</span><span class="pl-ent">static</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-k">fn</span> <span class="pl-en">takes_foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">F</span><span class="pl-kos">:</span> <span class="pl-smi">Foo</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-en">require_static</span><span class="pl-kos">::</span><span class="pl-kos">&lt;</span><span class="pl-smi">F</span><span class="pl-kos">::</span><span class="pl-smi">Value</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Since <code class="notranslate">Foo::Value</code> is bounded with <code class="notranslate">'static</code>, we would expect this to compile, but instead we get this error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;anon&gt;:6:3: 6:29 error: the associated type `&lt;F as Foo&gt;::Value` may not live long enough
&lt;anon&gt;:6   require_static::&lt;F::Value&gt;()
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;anon&gt;:6:3: 6:29 help: consider adding an explicit lifetime bound `&lt;F as Foo&gt;::Value: 'static`...
&lt;anon&gt;:6   require_static::&lt;F::Value&gt;()
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;anon&gt;:6:3: 6:29 note: ...so that the declared lifetime parameter bounds are satisfied
&lt;anon&gt;:6   require_static::&lt;F::Value&gt;()
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error"><pre class="notranslate"><code class="notranslate">&lt;anon&gt;:6:3: 6:29 error: the associated type `&lt;F as Foo&gt;::Value` may not live long enough
&lt;anon&gt;:6   require_static::&lt;F::Value&gt;()
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;anon&gt;:6:3: 6:29 help: consider adding an explicit lifetime bound `&lt;F as Foo&gt;::Value: 'static`...
&lt;anon&gt;:6   require_static::&lt;F::Value&gt;()
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;anon&gt;:6:3: 6:29 note: ...so that the declared lifetime parameter bounds are satisfied
&lt;anon&gt;:6   require_static::&lt;F::Value&gt;()
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
</code></pre></div>
<p dir="auto">Which seems redundant, if not incorrect.</p>
<p dir="auto">playpen: <a href="http://is.gd/UkEaDV" rel="nofollow">http://is.gd/UkEaDV</a></p>
<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> from IRC</p>