<p dir="auto">I'm trying to compile the <a href="http://doc.rust-lang.org/std/io/net/tcp/struct.TcpListener.html#example" rel="nofollow">TcpListener example from the docs</a> with <code class="notranslate">rustc -g</code> (via <code class="notranslate">cargo build</code>) and I'm getting this error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src/main.rs:15:9: 15:15 error: internal compiler error: debuginfo::create_for_loop_var_metadata() - Referenced variable location is not an alloca!
src/main.rs:15     for stream in acceptor.incoming() {
                       ^~~~~~
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
thread 'rustc' panicked at 'Box&lt;Any&gt;', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:123

stack backtrace:
   1:        0x1136332f8 - sys::backtrace::write::he7909da9eb6468e9fBt
   2:        0x113653c03 - failure::on_fail::hb7ba51d37f883f003Qz
   3:        0x1135bfcfa - rt::unwind::begin_unwind_inner::hf4af2222e6b64258uyz
   4:        0x1114c4d97 - rt::unwind::begin_unwind::h8565474196370893881
   5:        0x1114c4d30 - rt::unwind::begin_unwind::h8565474196370893881
   6:        0x11093a52d - session::Session::span_bug::hf51aebfd6f9bd43e1on
   7:        0x1100e8904 - middle::pat_util::pat_bindings::closure.49095
   8:        0x11148fcd1 - ast_util::walk_pat::h8ae3b0f1f213c350lxC
   9:        0x11001da90 - trans::expr::trans_rvalue_stmt_unadjusted::hd7e98e6041ff86d1l4i
  10:        0x10ffd5835 - trans::expr::trans_into::h24b0113a1e4ebf0euGh
  11:        0x10ffd47cb - trans::controlflow::trans_stmt_semi::he012fdd638652fbcgZd
  12:        0x10ffd5e72 - trans::controlflow::trans_block::hc3b3fec5a3fb9ff79Zd
  13:        0x110080234 - trans::base::trans_closure::hd46f470562b1daa76au
  14:        0x10ffca622 - trans::base::trans_fn::hbf7352ab9dfcd879nmu
  15:        0x10ffc5e33 - trans::base::trans_item::hf69d9d491dc08772rHu
  16:        0x110086d38 - trans::base::trans_crate::h82eea2293a06ce55HDv
  17:        0x10fdc950e - driver::phase_4_translate_to_llvm::h3268e7acb055bc171Ca
  18:        0x10fda32d8 - driver::compile_input::ha7c31ba4e10c023avba
  19:        0x10ff1b8e6 - thunk::F.Invoke&lt;A,$u{20}R$GT$::invoke::h2822247860475515909
  20:        0x10ff181e9 - rt::unwind::try::try_fn::h6416506685293600697
  21:        0x1136b9d29 - rust_try_inner
  22:        0x1136b9d16 - rust_try
  23:        0x10ff188e7 - thunk::F.Invoke&lt;A,$u{20}R$GT$::invoke::h15537213600061603954
  24:        0x1136431d4 - sys::thread::thread_start::h3cbfc0fe9ecfb222Kww
  25:     0x7fff9bc942fc - _pthread_body
  26:     0x7fff9bc94279 - _pthread_body"><pre class="notranslate"><code class="notranslate">src/main.rs:15:9: 15:15 error: internal compiler error: debuginfo::create_for_loop_var_metadata() - Referenced variable location is not an alloca!
src/main.rs:15     for stream in acceptor.incoming() {
                       ^~~~~~
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
thread 'rustc' panicked at 'Box&lt;Any&gt;', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:123

stack backtrace:
   1:        0x1136332f8 - sys::backtrace::write::he7909da9eb6468e9fBt
   2:        0x113653c03 - failure::on_fail::hb7ba51d37f883f003Qz
   3:        0x1135bfcfa - rt::unwind::begin_unwind_inner::hf4af2222e6b64258uyz
   4:        0x1114c4d97 - rt::unwind::begin_unwind::h8565474196370893881
   5:        0x1114c4d30 - rt::unwind::begin_unwind::h8565474196370893881
   6:        0x11093a52d - session::Session::span_bug::hf51aebfd6f9bd43e1on
   7:        0x1100e8904 - middle::pat_util::pat_bindings::closure.49095
   8:        0x11148fcd1 - ast_util::walk_pat::h8ae3b0f1f213c350lxC
   9:        0x11001da90 - trans::expr::trans_rvalue_stmt_unadjusted::hd7e98e6041ff86d1l4i
  10:        0x10ffd5835 - trans::expr::trans_into::h24b0113a1e4ebf0euGh
  11:        0x10ffd47cb - trans::controlflow::trans_stmt_semi::he012fdd638652fbcgZd
  12:        0x10ffd5e72 - trans::controlflow::trans_block::hc3b3fec5a3fb9ff79Zd
  13:        0x110080234 - trans::base::trans_closure::hd46f470562b1daa76au
  14:        0x10ffca622 - trans::base::trans_fn::hbf7352ab9dfcd879nmu
  15:        0x10ffc5e33 - trans::base::trans_item::hf69d9d491dc08772rHu
  16:        0x110086d38 - trans::base::trans_crate::h82eea2293a06ce55HDv
  17:        0x10fdc950e - driver::phase_4_translate_to_llvm::h3268e7acb055bc171Ca
  18:        0x10fda32d8 - driver::compile_input::ha7c31ba4e10c023avba
  19:        0x10ff1b8e6 - thunk::F.Invoke&lt;A,$u{20}R$GT$::invoke::h2822247860475515909
  20:        0x10ff181e9 - rt::unwind::try::try_fn::h6416506685293600697
  21:        0x1136b9d29 - rust_try_inner
  22:        0x1136b9d16 - rust_try
  23:        0x10ff188e7 - thunk::F.Invoke&lt;A,$u{20}R$GT$::invoke::h15537213600061603954
  24:        0x1136431d4 - sys::thread::thread_start::h3cbfc0fe9ecfb222Kww
  25:     0x7fff9bc942fc - _pthread_body
  26:     0x7fff9bc94279 - _pthread_body
</code></pre></div>
<p dir="auto">Running <code class="notranslate">rust --version --verbose</code> gives me this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 0.13.0-nightly (34d680009 2014-12-22 00:12:47 +0000)
binary: rustc
commit-hash: 34d680009205de2302b902d8f9f5f7ae7a042f1a
commit-date: 2014-12-22 00:12:47 +0000
host: x86_64-apple-darwin
release: 0.13.0-nightly"><pre class="notranslate"><code class="notranslate">rustc 0.13.0-nightly (34d680009 2014-12-22 00:12:47 +0000)
binary: rustc
commit-hash: 34d680009205de2302b902d8f9f5f7ae7a042f1a
commit-date: 2014-12-22 00:12:47 +0000
host: x86_64-apple-darwin
release: 0.13.0-nightly
</code></pre></div>
<p dir="auto">Note that running <code class="notranslate">rustc</code> without the <code class="notranslate">-g</code> flag compiles without issue.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src/config.rs:74:9: 74:10 error: internal compiler error: debuginfo::create_for_loop_var_metadata() - Referenced variable location is not an alloca!
src/config.rs:74     for i in range(1u, 10) {"><pre class="notranslate"><code class="notranslate">src/config.rs:74:9: 74:10 error: internal compiler error: debuginfo::create_for_loop_var_metadata() - Referenced variable location is not an alloca!
src/config.rs:74     for i in range(1u, 10) {
</code></pre></div>
<p dir="auto">Happens with the latest commit (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/34d680009205de2302b902d8f9f5f7ae7a042f1a/hovercard" href="https://github.com/rust-lang/rust/commit/34d680009205de2302b902d8f9f5f7ae7a042f1a"><tt>34d6800</tt></a>)</p>