<p dir="auto">Back a couple weeks ago, I had a program with this code here:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="for ch in msg.chars() {
        if !ch.is_alphabetic() { continue; }
        let s = caesar_shift(ch, key);
        e.push(s);
    }"><pre class="notranslate"><span class="pl-k">for</span> ch <span class="pl-k">in</span> msg<span class="pl-kos">.</span><span class="pl-en">chars</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">if</span> !ch<span class="pl-kos">.</span><span class="pl-en">is_alphabetic</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">continue</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
        <span class="pl-k">let</span> s = <span class="pl-en">caesar_shift</span><span class="pl-kos">(</span>ch<span class="pl-kos">,</span> key<span class="pl-kos">)</span><span class="pl-kos">;</span>
        e<span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span>s<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span></pre></div>
<p dir="auto">This code compiled just fine, where msg is an <code class="notranslate">&amp;str</code> parameter to the function in question.</p>
<p dir="auto">Now, having duplicated the same code with the same variable as:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="for ch in msg.chars() {
            if !ch.is_alphabetic() { continue; }
            let p = ch.to_digit(36).unwrap() - 10;  // Need to shift down by 10 for range of 0-25
            let c = alpha.chars().nth(p as usize).unwrap();
            e.push(c);
        }"><pre class="notranslate"><span class="pl-k">for</span> ch <span class="pl-k">in</span> msg<span class="pl-kos">.</span><span class="pl-en">chars</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">if</span> !ch<span class="pl-kos">.</span><span class="pl-en">is_alphabetic</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">continue</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
            <span class="pl-k">let</span> p = ch<span class="pl-kos">.</span><span class="pl-en">to_digit</span><span class="pl-kos">(</span><span class="pl-c1">36</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span> - <span class="pl-c1">10</span><span class="pl-kos">;</span>  <span class="pl-c">// Need to shift down by 10 for range of 0-25</span>
            <span class="pl-k">let</span> c = alpha<span class="pl-kos">.</span><span class="pl-en">chars</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">nth</span><span class="pl-kos">(</span>p <span class="pl-k">as</span> <span class="pl-smi">usize</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            e<span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span>c<span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span></pre></div>
<p dir="auto">the compiler presents this error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src/lib/classical.rs:163:9: 168:10 error: mismatched types:
 expected `collections::string::String`,
    found `()`
(expected struct `collections::string::String`,
    found ()) [E0308]
src/lib/classical.rs:163         for ch in msg.chars() {
src/lib/classical.rs:164             if !ch.is_alphabetic() { continue; }
src/lib/classical.rs:165             let p = ch.to_digit(36).unwrap() - 10;  // Need to shift down by 10 for range of 0-25
src/lib/classical.rs:166             let c = alpha.chars().nth(p as usize).unwrap();
src/lib/classical.rs:167             e.push(c);
src/lib/classical.rs:168         }
note: in expansion of for loop expansion
src/lib/classical.rs:163:9: 168:10 note: expansion site
src/lib/classical.rs:163:9: 168:10 help: run `rustc --explain E0308` to see a detailed explanation"><pre class="notranslate"><code class="notranslate">src/lib/classical.rs:163:9: 168:10 error: mismatched types:
 expected `collections::string::String`,
    found `()`
(expected struct `collections::string::String`,
    found ()) [E0308]
src/lib/classical.rs:163         for ch in msg.chars() {
src/lib/classical.rs:164             if !ch.is_alphabetic() { continue; }
src/lib/classical.rs:165             let p = ch.to_digit(36).unwrap() - 10;  // Need to shift down by 10 for range of 0-25
src/lib/classical.rs:166             let c = alpha.chars().nth(p as usize).unwrap();
src/lib/classical.rs:167             e.push(c);
src/lib/classical.rs:168         }
note: in expansion of for loop expansion
src/lib/classical.rs:163:9: 168:10 note: expansion site
src/lib/classical.rs:163:9: 168:10 help: run `rustc --explain E0308` to see a detailed explanation
</code></pre></div>
<p dir="auto">This was using the nightly build in both cases:</p>
<p dir="auto">Now: <code class="notranslate">rustc 1.4.0-nightly (f3f23bf9c 2015-08-30)</code><br>
Then: <code class="notranslate">rustc 1.4.0-nightly (ab450ef22 2015-08-14)</code></p>
<p dir="auto">Strangely, the old code does not cause the compiler to error out, but I see literally no difference in the new code to speak of that would cause it to not understand what type msg is.</p>
<p dir="auto">Here's an example of where this gets really painful:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use std::rt::io;            

fn foo(a: &amp;mut io::Stream) {
    write!(a, &quot;test&quot;);      
}                           
fn main() {                 
}                           "><pre class="notranslate"><span class="pl-k">use</span> std<span class="pl-kos">::</span>rt<span class="pl-kos">::</span>io<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-s1">a</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> io<span class="pl-kos">::</span><span class="pl-smi">Stream</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-en">write</span><span class="pl-en">!</span><span class="pl-kos">(</span>a, <span class="pl-s">"test"</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">yields</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="foo.rs:4:11: 4:12 error: mismatched types: expected `&amp;mut std::rt::io::Writer&lt;no-bounds&gt;` but found `&amp;mut std::rt::io::Stream&lt;no-bounds&gt;` (expected trait std::rt::io::Writer but found trait std::rt::io::Stream)
foo.rs:4     write!(a, &quot;test&quot;);
                    ^
note: in expansion of format_args!
&lt;std-macros&gt;:225:8: 225:72 note: expansion site
&lt;std-macros&gt;:224:4: 226:6 note: in expansion of write!
foo.rs:4:4: 4:22 note: expansion site
error: aborting due to previous error"><pre class="notranslate"><code class="notranslate">foo.rs:4:11: 4:12 error: mismatched types: expected `&amp;mut std::rt::io::Writer&lt;no-bounds&gt;` but found `&amp;mut std::rt::io::Stream&lt;no-bounds&gt;` (expected trait std::rt::io::Writer but found trait std::rt::io::Stream)
foo.rs:4     write!(a, "test");
                    ^
note: in expansion of format_args!
&lt;std-macros&gt;:225:8: 225:72 note: expansion site
&lt;std-macros&gt;:224:4: 226:6 note: in expansion of write!
foo.rs:4:4: 4:22 note: expansion site
error: aborting due to previous error
</code></pre></div>
<p dir="auto">Nominating for production-ready (and possibly priority)</p>