<p dir="auto">The following program causes an ICE:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fn main() {
    match (&quot;&quot;, &quot;&quot;) {
        (a, &quot;&quot;) =&gt; a,
        (&quot;&quot;, b) =&gt; b,
    };
}"><pre class="notranslate"><code class="notranslate">fn main() {
    match ("", "") {
        (a, "") =&gt; a,
        ("", b) =&gt; b,
    };
}
</code></pre></div>
<p dir="auto">The compiler output, with backtraces enabled, is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ RUST_BACKTRACE=1 rustc test.rs
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. 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' failed at 'index out of bounds: the len is 0 but the index is 0', /home/matt/code/apps/rust/rust/src/librustc/middle/check_match.rs:250

stack backtrace:
   1:     0x7fa0afc51af0 - rt::backtrace::imp::write::h58498fa079570ea6AGp::v0.11.0.pre
   2:     0x7fa0afc59220 - failure::on_fail::ha6379e4c4ae5dc18N1p::v0.11.0.pre
   3:     0x7fa0b03ef870 - unwind::begin_unwind_inner::hd80eddaab5a23324QRd::v0.11.0.pre
   4:     0x7fa0b03ef300 - unwind::begin_unwind_fmt::h9099725093fae462jPd::v0.11.0.pre
   5:     0x7fa0b03ef2c0 - rust_begin_unwind
   6:     0x7fa0b043e110 - failure::begin_unwind::h6da20b95db835a9a23v::v0.11.0.pre
   7:     0x7fa0b0441f00 - failure::fail_bounds_check::h4924096447067a67e2v::v0.11.0.pre
   8:     0x7fa0b0f1e880 - middle::check_match::is_useful::h86038b3c4ff660f459A::v0.11.0.pre
   9:     0x7fa0b0f1e880 - middle::check_match::is_useful::h86038b3c4ff660f459A::v0.11.0.pre
  10:     0x7fa0b0f242c0 - middle::check_match::is_useful_specialized::h8c30afeb07f47663nhB::v0.11.0.pre
  11:     0x7fa0b0f1e880 - middle::check_match::is_useful::h86038b3c4ff660f459A::v0.11.0.pre
  12:     0x7fa0b0f242c0 - middle::check_match::is_useful_specialized::h8c30afeb07f47663nhB::v0.11.0.pre
  13:     0x7fa0b0f1e880 - middle::check_match::is_useful::h86038b3c4ff660f459A::v0.11.0.pre
  14:     0x7fa0b0f18f90 - middle::check_match::check_expr::hf9af3ea0df0373f5BRA::v0.11.0.pre
  15:     0x7fa0b0f1dca0 - visit::Visitor::visit_block::h9833201876906112987::v0.11.0.pre
  16:     0x7fa0b0f1ba90 - middle::check_match::check_fn::hbc4df80e3ee3042bBQB::v0.11.0.pre
  17:     0x7fa0b0f1c9d0 - visit::walk_item::h15784207179804928906::v0.11.0.pre
  18:     0x7fa0b0f1bf40 - middle::check_match::check_crate::hf2b699455d6a2b2b7QA::v0.11.0.pre
  19:     0x7fa0b13c0bf0 - driver::driver::phase_3_run_analysis_passes::h26bdb20640374ad81mv::v0.11.0.pre
  20:     0x7fa0b13b9160 - driver::driver::compile_input::h71908766a89db12fgbv::v0.11.0.pre
  21:     0x7fa0b1483c10 - driver::run_compiler::h75dfd515de0d47cfOSx::v0.11.0.pre
  22:     0x7fa0b1483b20 - driver::main_args::closure.98525
  23:     0x7fa0b149f680 - driver::monitor::closure.99615
  24:     0x7fa0b149a5c0 - task::TaskBuilder::try::closure.99378
  25:     0x7fa0b33bfc60 - task::spawn_opts::closure.7148
  26:     0x7fa0b03ec420 - task::Task::run::closure.5303
  27:     0x7fa0b0457960 - rust_try
  28:     0x7fa0b03eee60 - unwind::try::ha9ea19d69d80ec42fGd::v0.11.0.pre
  29:     0x7fa0b03ec2a0 - task::Task::run::h0268eeb27ce86be2VVc::v0.11.0.pre
  30:     0x7fa0b33bfa00 - task::spawn_opts::closure.7121
  31:     0x7fa0b03ee430 - thread::thread_start::hf5e1787e63284712kdd::v0.11.0.pre
  32:     0x7fa0af6cd000 - start_thread
  33:     0x7fa0b00c4fc9 - __clone
  34:                0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">$ RUST_BACKTRACE=1 rustc test.rs
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. 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' failed at 'index out of bounds: the len is 0 but the index is 0', /home/matt/code/apps/rust/rust/src/librustc/middle/check_match.rs:250

stack backtrace:
   1:     0x7fa0afc51af0 - rt::backtrace::imp::write::h58498fa079570ea6AGp::v0.11.0.pre
   2:     0x7fa0afc59220 - failure::on_fail::ha6379e4c4ae5dc18N1p::v0.11.0.pre
   3:     0x7fa0b03ef870 - unwind::begin_unwind_inner::hd80eddaab5a23324QRd::v0.11.0.pre
   4:     0x7fa0b03ef300 - unwind::begin_unwind_fmt::h9099725093fae462jPd::v0.11.0.pre
   5:     0x7fa0b03ef2c0 - rust_begin_unwind
   6:     0x7fa0b043e110 - failure::begin_unwind::h6da20b95db835a9a23v::v0.11.0.pre
   7:     0x7fa0b0441f00 - failure::fail_bounds_check::h4924096447067a67e2v::v0.11.0.pre
   8:     0x7fa0b0f1e880 - middle::check_match::is_useful::h86038b3c4ff660f459A::v0.11.0.pre
   9:     0x7fa0b0f1e880 - middle::check_match::is_useful::h86038b3c4ff660f459A::v0.11.0.pre
  10:     0x7fa0b0f242c0 - middle::check_match::is_useful_specialized::h8c30afeb07f47663nhB::v0.11.0.pre
  11:     0x7fa0b0f1e880 - middle::check_match::is_useful::h86038b3c4ff660f459A::v0.11.0.pre
  12:     0x7fa0b0f242c0 - middle::check_match::is_useful_specialized::h8c30afeb07f47663nhB::v0.11.0.pre
  13:     0x7fa0b0f1e880 - middle::check_match::is_useful::h86038b3c4ff660f459A::v0.11.0.pre
  14:     0x7fa0b0f18f90 - middle::check_match::check_expr::hf9af3ea0df0373f5BRA::v0.11.0.pre
  15:     0x7fa0b0f1dca0 - visit::Visitor::visit_block::h9833201876906112987::v0.11.0.pre
  16:     0x7fa0b0f1ba90 - middle::check_match::check_fn::hbc4df80e3ee3042bBQB::v0.11.0.pre
  17:     0x7fa0b0f1c9d0 - visit::walk_item::h15784207179804928906::v0.11.0.pre
  18:     0x7fa0b0f1bf40 - middle::check_match::check_crate::hf2b699455d6a2b2b7QA::v0.11.0.pre
  19:     0x7fa0b13c0bf0 - driver::driver::phase_3_run_analysis_passes::h26bdb20640374ad81mv::v0.11.0.pre
  20:     0x7fa0b13b9160 - driver::driver::compile_input::h71908766a89db12fgbv::v0.11.0.pre
  21:     0x7fa0b1483c10 - driver::run_compiler::h75dfd515de0d47cfOSx::v0.11.0.pre
  22:     0x7fa0b1483b20 - driver::main_args::closure.98525
  23:     0x7fa0b149f680 - driver::monitor::closure.99615
  24:     0x7fa0b149a5c0 - task::TaskBuilder::try::closure.99378
  25:     0x7fa0b33bfc60 - task::spawn_opts::closure.7148
  26:     0x7fa0b03ec420 - task::Task::run::closure.5303
  27:     0x7fa0b0457960 - rust_try
  28:     0x7fa0b03eee60 - unwind::try::ha9ea19d69d80ec42fGd::v0.11.0.pre
  29:     0x7fa0b03ec2a0 - task::Task::run::h0268eeb27ce86be2VVc::v0.11.0.pre
  30:     0x7fa0b33bfa00 - task::spawn_opts::closure.7121
  31:     0x7fa0b03ee430 - thread::thread_start::hf5e1787e63284712kdd::v0.11.0.pre
  32:     0x7fa0af6cd000 - start_thread
  33:     0x7fa0b00c4fc9 - __clone
  34:                0x0 - &lt;unknown&gt;
</code></pre></div>
<p dir="auto">Rust version:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ rustc -v     
rustc 0.11.0-pre (6d8342f 2014-06-14 17:51:49 +0000)
host: x86_64-unknown-linux-gnu"><pre class="notranslate"><code class="notranslate">$ rustc -v     
rustc 0.11.0-pre (6d8342f 2014-06-14 17:51:49 +0000)
host: x86_64-unknown-linux-gnu
</code></pre></div>
<p dir="auto">running on Debian unstable.</p>
<p dir="auto">Code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
    match (&quot;&quot;, ()) {
        (_, _) =&gt; (),
        (&quot;&quot;, _) =&gt; (),
    }
}"><pre class="notranslate"><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">match</span> <span class="pl-kos">(</span><span class="pl-s">""</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>_<span class="pl-kos">,</span> _<span class="pl-kos">)</span> =&gt; <span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-kos">(</span><span class="pl-s">""</span><span class="pl-kos">,</span> _<span class="pl-kos">)</span> =&gt; <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">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="~ &gt; rustc test.rs
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index out of bounds: the len is 0 but the index is 0', /build/rust-git/src/rust/src/librustc/middle/check_match.rs:262
stack backtrace:
   1:     0x7fb6b7174290 - rt::backtrace::imp::write::h2bd81792b12baabaPUy::v0.11.0.pre
   2:     0x7fb6b70f1020 - rt::unwind::begin_unwind_inner::hf025459ac89965dbXuy::v0.11.0.pre
   3:     0x7fb6b70e97e0 - rt::unwind::begin_unwind_fmt::hdf2abde05ea171af7ty::v0.11.0.pre
   4:     0x7fb6b7174030 - rust_begin_unwind
   5:     0x7fb6b71b6120 - failure::begin_unwind::hd8511e7163654fd6IOv::v0.11.0.pre
   6:     0x7fb6b71b6d70 - failure::fail_bounds_check::ha1974902474a29f7IMv::v0.11.0.pre
   7:     0x7fb6b7e3d900 - &lt;unknown&gt;
   8:     0x7fb6b7e3d900 - &lt;unknown&gt;
   9:     0x7fb6b7e43830 - &lt;unknown&gt;
  10:     0x7fb6b7e3d900 - &lt;unknown&gt;
  11:     0x7fb6b7e43830 - &lt;unknown&gt;
  12:     0x7fb6b7e3d900 - &lt;unknown&gt;
  13:     0x7fb6b7e37170 - &lt;unknown&gt;
  14:     0x7fb6b7e3ced0 - &lt;unknown&gt;
  15:     0x7fb6b7e39d90 - &lt;unknown&gt;
  16:     0x7fb6b7e3a960 - &lt;unknown&gt;
  17:     0x7fb6b7e3a010 - middle::check_match::check_crate::h4ecc262850114c4bYQw::v0.11.0.pre
  18:     0x7fb6b7e32380 - &lt;unknown&gt;
  19:     0x7fb6b82a2f60 - driver::driver::phase_3_run_analysis_passes::h9fe69b3bb03d321dITj::v0.11.0.pre
  20:     0x7fb6b829c160 - driver::driver::compile_input::hc60c22b08c843c82iJj::v0.11.0.pre
  21:     0x7fb6b8367980 - &lt;unknown&gt;
  22:     0x7fb6b83678a0 - &lt;unknown&gt;
  23:     0x7fb6b837cb70 - &lt;unknown&gt;
  24:     0x7fb6b8377e60 - &lt;unknown&gt;
  25:     0x7fb6ba209f10 - &lt;unknown&gt;
  26:     0x7fb6b716e410 - &lt;unknown&gt;
  27:     0x7fb6b71cbdf0 - rust_try
  28:     0x7fb6b716e360 - rt::task::Task::run::h5672b3545148c66eAjw::v0.11.0.pre
  29:     0x7fb6ba209cc0 - &lt;unknown&gt;
  30:     0x7fb6b7172690 - &lt;unknown&gt;
  31:     0x7fb6b6ab8060 - start_thread
  32:     0x7fb6b6db8489 - __clone
  33:                0x0 - &lt;unknown&gt;
~ &gt; rustc -v
rustc 0.11.0-pre (87ad19e 2014-05-22 15:16:31 -0700)
host: x86_64-unknown-linux-gnu"><pre class="notranslate"><code class="notranslate">~ &gt; rustc test.rs
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index out of bounds: the len is 0 but the index is 0', /build/rust-git/src/rust/src/librustc/middle/check_match.rs:262
stack backtrace:
   1:     0x7fb6b7174290 - rt::backtrace::imp::write::h2bd81792b12baabaPUy::v0.11.0.pre
   2:     0x7fb6b70f1020 - rt::unwind::begin_unwind_inner::hf025459ac89965dbXuy::v0.11.0.pre
   3:     0x7fb6b70e97e0 - rt::unwind::begin_unwind_fmt::hdf2abde05ea171af7ty::v0.11.0.pre
   4:     0x7fb6b7174030 - rust_begin_unwind
   5:     0x7fb6b71b6120 - failure::begin_unwind::hd8511e7163654fd6IOv::v0.11.0.pre
   6:     0x7fb6b71b6d70 - failure::fail_bounds_check::ha1974902474a29f7IMv::v0.11.0.pre
   7:     0x7fb6b7e3d900 - &lt;unknown&gt;
   8:     0x7fb6b7e3d900 - &lt;unknown&gt;
   9:     0x7fb6b7e43830 - &lt;unknown&gt;
  10:     0x7fb6b7e3d900 - &lt;unknown&gt;
  11:     0x7fb6b7e43830 - &lt;unknown&gt;
  12:     0x7fb6b7e3d900 - &lt;unknown&gt;
  13:     0x7fb6b7e37170 - &lt;unknown&gt;
  14:     0x7fb6b7e3ced0 - &lt;unknown&gt;
  15:     0x7fb6b7e39d90 - &lt;unknown&gt;
  16:     0x7fb6b7e3a960 - &lt;unknown&gt;
  17:     0x7fb6b7e3a010 - middle::check_match::check_crate::h4ecc262850114c4bYQw::v0.11.0.pre
  18:     0x7fb6b7e32380 - &lt;unknown&gt;
  19:     0x7fb6b82a2f60 - driver::driver::phase_3_run_analysis_passes::h9fe69b3bb03d321dITj::v0.11.0.pre
  20:     0x7fb6b829c160 - driver::driver::compile_input::hc60c22b08c843c82iJj::v0.11.0.pre
  21:     0x7fb6b8367980 - &lt;unknown&gt;
  22:     0x7fb6b83678a0 - &lt;unknown&gt;
  23:     0x7fb6b837cb70 - &lt;unknown&gt;
  24:     0x7fb6b8377e60 - &lt;unknown&gt;
  25:     0x7fb6ba209f10 - &lt;unknown&gt;
  26:     0x7fb6b716e410 - &lt;unknown&gt;
  27:     0x7fb6b71cbdf0 - rust_try
  28:     0x7fb6b716e360 - rt::task::Task::run::h5672b3545148c66eAjw::v0.11.0.pre
  29:     0x7fb6ba209cc0 - &lt;unknown&gt;
  30:     0x7fb6b7172690 - &lt;unknown&gt;
  31:     0x7fb6b6ab8060 - start_thread
  32:     0x7fb6b6db8489 - __clone
  33:                0x0 - &lt;unknown&gt;
~ &gt; rustc -v
rustc 0.11.0-pre (87ad19e 2014-05-22 15:16:31 -0700)
host: x86_64-unknown-linux-gnu
</code></pre></div>