<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn foo(a: int, a: bool) {
    println(fmt!(&quot;%?&quot;, a));
}
fn main() {
    foo(42, false);
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-s1">a</span><span class="pl-kos">:</span> <span class="pl-smi">bool</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-en">println</span><span class="pl-kos">(</span><span class="pl-en">fmt</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"%?"</span>, a<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-en">foo</span><span class="pl-kos">(</span><span class="pl-c1">42</span><span class="pl-kos">,</span> <span class="pl-c1">false</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I expect this to fail to compile on account of the duplicated argument name. Instead:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;anon&gt;:1:7: 1:8 warning: unused variable: `a` [-W unused-variable (default)]
&lt;anon&gt;:1 fn foo(a: int, a: bool) {
                ^"><pre class="notranslate"><code class="notranslate">&lt;anon&gt;:1:7: 1:8 warning: unused variable: `a` [-W unused-variable (default)]
&lt;anon&gt;:1 fn foo(a: int, a: bool) {
                ^
</code></pre></div>
<p dir="auto">And running it writes <code class="notranslate">false</code>. The first argument is wholly inaccessible.</p>
<p dir="auto">The librustc binary contains 657 string constants containing "bounds check". There is opportunity for reduction here.</p>