<p dir="auto"><code class="notranslate">oneshot</code> returns <code class="notranslate">(ChanOne, PortOne)</code> while <code class="notranslate">stream</code> returns <code class="notranslate">(Port, Chan)</code>. I prefer the port to be first.</p>
<h2 dir="auto">Updated Test Case (warning: may not be faithful to the original problem)</h2>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use core::io::ReaderUtil;
use core::io::Reader;

fn foo(r:@Reader) -&gt; ~str { r.read_line() }
fn baz&lt;R:Reader&gt;(r:R) -&gt; ~str { r.read_line() }
fn waz&lt;R:ReaderUtil&gt;(r:R) -&gt; ~str { r.read_line() }

fn main() {
    let _m = foo(io::stdin());
    let _m = baz(io::stdin());
    let _m = waz(io::stdin());
}"><pre class="notranslate"><span class="pl-k">use</span> core<span class="pl-kos">::</span>io<span class="pl-kos">::</span><span class="pl-v">ReaderUtil</span><span class="pl-kos">;</span>
<span class="pl-k">use</span> core<span class="pl-kos">::</span>io<span class="pl-kos">::</span><span class="pl-v">Reader</span><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">r</span><span class="pl-kos">:</span>@<span class="pl-smi">Reader</span><span class="pl-kos">)</span> -&gt; ~<span class="pl-smi">str</span> <span class="pl-kos">{</span> r<span class="pl-kos">.</span><span class="pl-en">read_line</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">baz</span><span class="pl-kos">&lt;</span><span class="pl-smi">R</span><span class="pl-kos">:</span><span class="pl-smi">Reader</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-kos">:</span><span class="pl-smi">R</span><span class="pl-kos">)</span> -&gt; ~<span class="pl-smi">str</span> <span class="pl-kos">{</span> r<span class="pl-kos">.</span><span class="pl-en">read_line</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">waz</span><span class="pl-kos">&lt;</span><span class="pl-smi">R</span><span class="pl-kos">:</span><span class="pl-smi">ReaderUtil</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-kos">:</span><span class="pl-smi">R</span><span class="pl-kos">)</span> -&gt; ~<span class="pl-smi">str</span> <span class="pl-kos">{</span> r<span class="pl-kos">.</span><span class="pl-en">read_line</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-k">let</span> _m = <span class="pl-en">foo</span><span class="pl-kos">(</span>io<span class="pl-kos">::</span><span class="pl-en">stdin</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">let</span> _m = <span class="pl-en">baz</span><span class="pl-kos">(</span>io<span class="pl-kos">::</span><span class="pl-en">stdin</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">let</span> _m = <span class="pl-en">waz</span><span class="pl-kos">(</span>io<span class="pl-kos">::</span><span class="pl-en">stdin</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>
<h2 dir="auto">Original Report</h2>
<p dir="auto">The following code compiles, but causes a segmentation fault when run:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let stdin = io::stdin() as &amp;io::ReaderUtil;
let _m = stdin.read_line();"><pre class="notranslate"><code class="notranslate">let stdin = io::stdin() as &amp;io::ReaderUtil;
let _m = stdin.read_line();
</code></pre></div>
<p dir="auto">This is using master on Ubuntu.</p>