<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rillian/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rillian">@rillian</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/evanmcc/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/evanmcc">@evanmcc</a> have both encountered a build failure -- same place -- stage1 segfaults when building optimized on atom. Seems independent of distribution, (happens on FC17 and Ubuntu oneiric). Both machines were atoms. Tried builds on emulated non-atoms, same distros, no fault. Think it's atom-specific. Might be a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3325735" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1879" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1879/hovercard" href="https://github.com/rust-lang/rust/issues/1879">#1879</a> (requirement for subtargets).</p>
<p dir="auto">This code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![feature(if_let, while_let)]

use std::io;

pub struct Test&lt;W: Writer&gt; {
    writer: W,
}

impl&lt;W: Writer&gt; Test&lt;W&gt; {

    pub fn new(writer: W) -&gt; Test&lt;W&gt; {
        Test {
            writer: writer,
        }
    }

    pub fn write_something(&amp;mut self) -&gt; io::IoResult&lt;()&gt; {
        try!(writeln!(self.writer, &quot;&quot;));
        Ok(())
    }
}"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>feature<span class="pl-kos">(</span>if_let<span class="pl-kos">,</span> while_let<span class="pl-kos">)</span><span class="pl-kos">]</span></span>

<span class="pl-k">use</span> std<span class="pl-kos">::</span>io<span class="pl-kos">;</span>

<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">Test</span><span class="pl-kos">&lt;</span><span class="pl-smi">W</span><span class="pl-kos">:</span> <span class="pl-smi">Writer</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-c1">writer</span><span class="pl-kos">:</span> <span class="pl-smi">W</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>

<span class="pl-k">impl</span><span class="pl-kos">&lt;</span><span class="pl-smi">W</span><span class="pl-kos">:</span> <span class="pl-smi">Writer</span><span class="pl-kos">&gt;</span> <span class="pl-smi">Test</span><span class="pl-kos">&lt;</span><span class="pl-smi">W</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>

    <span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-s1">writer</span><span class="pl-kos">:</span> <span class="pl-smi">W</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">Test</span><span class="pl-kos">&lt;</span><span class="pl-smi">W</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-smi">Test</span> <span class="pl-kos">{</span>
            <span class="pl-c1">writer</span><span class="pl-kos">:</span> writer<span class="pl-kos">,</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">write_something</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-smi">self</span><span class="pl-kos">)</span> -&gt; io<span class="pl-kos">::</span><span class="pl-smi">IoResult</span><span class="pl-kos">&lt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-en">try</span><span class="pl-en">!</span><span class="pl-kos">(</span>writeln!<span class="pl-kos">(</span><span class="pl-smi">self</span>.writer, <span class="pl-s">""</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-v">Ok</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>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Produces this very hard to understand error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;std macros&gt;:3:24: 18:34 error: type `W` cannot be dereferenced
&lt;std macros&gt;:3         let dst = &amp;mut *$dst;
&lt;std macros&gt;:4         format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
&lt;std macros&gt;:5     })
&lt;std macros&gt;:6 )
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'index out of bounds: the len is 6 but the index is 6', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/lib.rs:1

stack backtrace:
   1:        0x10e61aba2 - rt::backtrace::imp::write::h90a8813e205226e59it
   2:        0x10e61dd3d - failure::on_fail::h02cd561a89cb7027gBt
   3:        0x10e88df65 - unwind::begin_unwind_inner::h4bc3350c0517820112c
   4:        0x10e88dbaf - unwind::begin_unwind_fmt::hd106a62827b11c87c0c
   5:        0x10e88d952 - rust_begin_unwind
   6:        0x10e8d8fec - panicking::panic_fmt::h17addcbe3c55edecaOl
   7:        0x10e8e15b1 - panicking::panic_bounds_check::he446012f6f64f624IMl
   8:        0x10c59c015 - codemap::FileMap::get_line::h765ba394c07c5a54m4E
   9:        0x10c5ca703 - diagnostic::emit::hb066201a777f2165wvG
  10:        0x10c5c6f98 - diagnostic::EmitterWriter.Emitter::emit::h165058475e3b3ec5lrG
  11:        0x10c5c5785 - diagnostic::Handler::emit::hde0ac2d5b40efe25F8F
  12:        0x10c5981ab - diagnostic::SpanHandler::span_err::h2eaa3c8ca5c5b97cEWF
  13:        0x10b9df920 - middle::typeck::infer::InferCtxt&lt;'a, 'tcx&gt;::type_error_message_str_with_expected::h6ee55cab43056003TKF
  14:        0x10b92f921 - middle::typeck::infer::InferCtxt&lt;'a, 'tcx&gt;::type_error_message::h3d8733aff7464519dQF
  15:        0x10b940539 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  16:        0x10b93e934 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  17:        0x10b96d0b3 - middle::typeck::check::check_decl_local::hfecf573d1629e05egto
  18:        0x10b96d2a3 - middle::typeck::check::check_stmt::h837abcc8fc4466f6gvo
  19:        0x10b8f41e8 - middle::typeck::check::check_block_with_expected::hb5675eefe857af90vzo
  20:        0x10b93a760 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  21:        0x10b82e2db - middle::typeck::check::_match::check_match::h3caf386ed888768e5P8
  22:        0x10b93a683 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  23:        0x10b8f4522 - middle::typeck::check::check_block_with_expected::hb5675eefe857af90vzo
  24:        0x10b93a760 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  25:        0x10b96d2fa - middle::typeck::check::check_stmt::h837abcc8fc4466f6gvo
  26:        0x10b8f41e8 - middle::typeck::check::check_block_with_expected::hb5675eefe857af90vzo
  27:        0x10b8cdf00 - middle::typeck::check::check_fn::hd44de11a490be98ce0i
  28:        0x10b8f0aae - middle::typeck::check::check_bare_fn::h3c7a1f5d35e30589jPi
  29:        0x10b8f754f - middle::typeck::check::check_method_body::he0c86eb88bb45c1blkj
  30:        0x10b8edb88 - middle::typeck::check::check_item::h4ddfa2a018f36791t9i
  31:        0x10b8f07d0 - middle::typeck::check::check_item_types::h1ade2b1cc61bf6batOi
  32:        0x10bc74826 - util::common::time::h8028586279873844585
  33:        0x10bc73ca4 - middle::typeck::check_crate::h3a5b374f87cce2eecwM
  34:        0x10b265393 - driver::driver::phase_3_run_analysis_passes::hdc8c835c5059844etfS
  35:        0x10b2598bc - driver::driver::compile_input::h1998d439bb2aa565dWR
  36:        0x10b2d7bc5 - driver::run_compiler::h8a3c490c622774caHUT
  37:        0x10b2d639e - driver::run::closure.59807
  38:        0x10b0edc5b - task::TaskBuilder&lt;S&gt;::try_future::closure.39061
  39:        0x10b0edb53 - task::TaskBuilder&lt;S&gt;::spawn_internal::closure.39032
  40:        0x10b0b17bd - task::NativeSpawner.Spawner::spawn::closure.2475
  41:        0x10e8f082c - rust_try_inner
  42:        0x10e8f0816 - rust_try
  43:        0x10e88b707 - unwind::try::h9549aa28335b576amRc
  44:        0x10e88b59c - task::Task::run::h7f22cfdcfa218bd192b
  45:        0x10b0b15e3 - task::NativeSpawner.Spawner::spawn::closure.2399
  46:        0x10e88cdd7 - thread::thread_start::h08cb83a10e608715foc
  47:     0x7fff9260c2fc - _pthread_body
  48:     0x7fff9260c279 - _pthread_body"><pre class="notranslate"><code class="notranslate">&lt;std macros&gt;:3:24: 18:34 error: type `W` cannot be dereferenced
&lt;std macros&gt;:3         let dst = &amp;mut *$dst;
&lt;std macros&gt;:4         format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
&lt;std macros&gt;:5     })
&lt;std macros&gt;:6 )
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'index out of bounds: the len is 6 but the index is 6', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/lib.rs:1

stack backtrace:
   1:        0x10e61aba2 - rt::backtrace::imp::write::h90a8813e205226e59it
   2:        0x10e61dd3d - failure::on_fail::h02cd561a89cb7027gBt
   3:        0x10e88df65 - unwind::begin_unwind_inner::h4bc3350c0517820112c
   4:        0x10e88dbaf - unwind::begin_unwind_fmt::hd106a62827b11c87c0c
   5:        0x10e88d952 - rust_begin_unwind
   6:        0x10e8d8fec - panicking::panic_fmt::h17addcbe3c55edecaOl
   7:        0x10e8e15b1 - panicking::panic_bounds_check::he446012f6f64f624IMl
   8:        0x10c59c015 - codemap::FileMap::get_line::h765ba394c07c5a54m4E
   9:        0x10c5ca703 - diagnostic::emit::hb066201a777f2165wvG
  10:        0x10c5c6f98 - diagnostic::EmitterWriter.Emitter::emit::h165058475e3b3ec5lrG
  11:        0x10c5c5785 - diagnostic::Handler::emit::hde0ac2d5b40efe25F8F
  12:        0x10c5981ab - diagnostic::SpanHandler::span_err::h2eaa3c8ca5c5b97cEWF
  13:        0x10b9df920 - middle::typeck::infer::InferCtxt&lt;'a, 'tcx&gt;::type_error_message_str_with_expected::h6ee55cab43056003TKF
  14:        0x10b92f921 - middle::typeck::infer::InferCtxt&lt;'a, 'tcx&gt;::type_error_message::h3d8733aff7464519dQF
  15:        0x10b940539 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  16:        0x10b93e934 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  17:        0x10b96d0b3 - middle::typeck::check::check_decl_local::hfecf573d1629e05egto
  18:        0x10b96d2a3 - middle::typeck::check::check_stmt::h837abcc8fc4466f6gvo
  19:        0x10b8f41e8 - middle::typeck::check::check_block_with_expected::hb5675eefe857af90vzo
  20:        0x10b93a760 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  21:        0x10b82e2db - middle::typeck::check::_match::check_match::h3caf386ed888768e5P8
  22:        0x10b93a683 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  23:        0x10b8f4522 - middle::typeck::check::check_block_with_expected::hb5675eefe857af90vzo
  24:        0x10b93a760 - middle::typeck::check::check_expr_with_unifier::h40fb1c6e261626f5Nzm
  25:        0x10b96d2fa - middle::typeck::check::check_stmt::h837abcc8fc4466f6gvo
  26:        0x10b8f41e8 - middle::typeck::check::check_block_with_expected::hb5675eefe857af90vzo
  27:        0x10b8cdf00 - middle::typeck::check::check_fn::hd44de11a490be98ce0i
  28:        0x10b8f0aae - middle::typeck::check::check_bare_fn::h3c7a1f5d35e30589jPi
  29:        0x10b8f754f - middle::typeck::check::check_method_body::he0c86eb88bb45c1blkj
  30:        0x10b8edb88 - middle::typeck::check::check_item::h4ddfa2a018f36791t9i
  31:        0x10b8f07d0 - middle::typeck::check::check_item_types::h1ade2b1cc61bf6batOi
  32:        0x10bc74826 - util::common::time::h8028586279873844585
  33:        0x10bc73ca4 - middle::typeck::check_crate::h3a5b374f87cce2eecwM
  34:        0x10b265393 - driver::driver::phase_3_run_analysis_passes::hdc8c835c5059844etfS
  35:        0x10b2598bc - driver::driver::compile_input::h1998d439bb2aa565dWR
  36:        0x10b2d7bc5 - driver::run_compiler::h8a3c490c622774caHUT
  37:        0x10b2d639e - driver::run::closure.59807
  38:        0x10b0edc5b - task::TaskBuilder&lt;S&gt;::try_future::closure.39061
  39:        0x10b0edb53 - task::TaskBuilder&lt;S&gt;::spawn_internal::closure.39032
  40:        0x10b0b17bd - task::NativeSpawner.Spawner::spawn::closure.2475
  41:        0x10e8f082c - rust_try_inner
  42:        0x10e8f0816 - rust_try
  43:        0x10e88b707 - unwind::try::h9549aa28335b576amRc
  44:        0x10e88b59c - task::Task::run::h7f22cfdcfa218bd192b
  45:        0x10b0b15e3 - task::NativeSpawner.Spawner::spawn::closure.2399
  46:        0x10e88cdd7 - thread::thread_start::h08cb83a10e608715foc
  47:     0x7fff9260c2fc - _pthread_body
  48:     0x7fff9260c279 - _pthread_body
</code></pre></div>