<p dir="auto">I try to compile this program in rustc but an internal compile error occurred that:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="task &lt;unnamed&gt; failed at 'assertion failed: is_utf8(v)', C:\bot\slave\dist2-win\build\src\libstd\str.rs:1032
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task &lt;unnamed&gt; failed at 'explicit failure', c:\bot\slave\dist2-win\build\src\librustc\rustc.rs:391"><pre class="notranslate"><code class="notranslate">task &lt;unnamed&gt; failed at 'assertion failed: is_utf8(v)', C:\bot\slave\dist2-win\build\src\libstd\str.rs:1032
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task &lt;unnamed&gt; failed at 'explicit failure', c:\bot\slave\dist2-win\build\src\librustc\rustc.rs:391
</code></pre></div>
<p dir="auto">this is my program:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="extern mod extra;
use extra::json::ToJson;

fn main () {
  let l = ~[1, 2, 3, 4];
  println(l.iter().filter(|&amp;x| *x &gt; 2).map(|&amp;x| x).to_owned_vec().to_json().to_str());
}"><pre class="notranslate"><span class="pl-k">extern</span> <span class="pl-k">mod</span> extra<span class="pl-kos">;</span>
<span class="pl-k">use</span> extra<span class="pl-kos">::</span>json<span class="pl-kos">::</span><span class="pl-v">ToJson</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-k">let</span> l = ~<span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
  <span class="pl-en">println</span><span class="pl-kos">(</span>l<span class="pl-kos">.</span><span class="pl-en">iter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span>|<span class="pl-c1">&amp;</span>x| <span class="pl-c1">*</span>x &gt; <span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span>|<span class="pl-c1">&amp;</span>x| x<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">to_owned_vec</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">to_json</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">to_str</span><span class="pl-kos">(</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">This error occurred both in Windows 8.1 64bit and windows XP 32bit.</p>
<p dir="auto">In many of the core and std libraries, the iface usage is flaky and ends up duplicating a lot of code.<br>
Many ifaces only implement some small arbitrary subset of the full set of functions, for example in str and vec. It makes code look awkward when you have something like <code class="notranslate">str::replace(foo, "x", "y").split_char('z')</code>.</p>
<p dir="auto">Additionally, all of the docs are duplicated for the iface functions and most of them are just inlines of calling something on self.</p>
<p dir="auto">Can all of the code be moved to just use iface impls instead of regular functions? Or something else?</p>