<p dir="auto">This code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait Foo&lt;T&gt; {}
struct Bar&lt;T&gt;;
impl&lt;T&gt; Foo&lt;T&gt; for Bar&lt;T&gt; {}

fn get&lt;H: Foo&lt;int&gt;&gt;(val: H) {}

fn main() {
    get(Bar);
}"><pre class="notranslate"><span class="pl-k">trait</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-kos">}</span>
<span class="pl-k">struct</span> <span class="pl-smi">Bar</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-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">Foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span> <span class="pl-k">for</span> <span class="pl-smi">Bar</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">fn</span> <span class="pl-en">get</span><span class="pl-kos">&lt;</span><span class="pl-smi">H</span><span class="pl-kos">:</span> <span class="pl-smi">Foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">int</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">val</span><span class="pl-kos">:</span> <span class="pl-smi">H</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-en">get</span><span class="pl-kos">(</span><span class="pl-v">Bar</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Is producing an error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;anon&gt;:8:5: 8:8 error: cannot determine a type for this bounded type parameter: unconstrained type
&lt;anon&gt;:8     get(Bar);
             ^~~"><pre class="notranslate"><code class="notranslate">&lt;anon&gt;:8:5: 8:8 error: cannot determine a type for this bounded type parameter: unconstrained type
&lt;anon&gt;:8     get(Bar);
             ^~~
</code></pre></div>
<p dir="auto">I'm not sure whether this is a bug or just a known limitation of type inference, but in both case it would be nice if it worked.</p>
<p dir="auto">Surprisingly I didn't manage to find a duplicate issue.</p>
<p dir="auto">Sometimes you just want to do something some number of times. There's no real concise way to express that right now.</p>