<p dir="auto">rustc --version<br>
rustc 0.6 (9143688 2013-02-14 14:44:12 -0800)<br>
host: x86_64-unknown-linux-gnu</p>
<p dir="auto">Found ICE when compiling this snippet:</p>
<p dir="auto">fn main() {<br>
match 0 {<br>
y if y &lt; 0 =&gt; ()<br>
}<br>
}</p>
<p dir="auto">Here is the backtrace:<br>
rust: task failed at 'Assertion (!pats.is_empty()) failed', .../src/librustc/middle/check_match.rs:135<br>
/usr/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7f7c0fd2aeeb]<br>
/usr/bin/../lib/librustrt.so(+0x2ac29)[0x7f7c0fd3bc29]<br>
/usr/bin/../lib/librustrt.so(upcall_fail+0x180)[0x7f7c0fd2ccf0]<br>
/usr/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xf858b)[0x7f7c1187358b]<br>
/usr/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x402de)[0x7f7c117bb2de]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match16check_exhaustive16_c41dd2a15ed85183_06E+0xa7f)[0x7f7c1058032f]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match10check_expr17_91da63eec117a1fb3_06E+0x865)[0x7f7c1057c365]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3febae)[0x7f7c1036bbae]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match8check_fn17_307b4ac256cbd1fb3_06E+0x153)[0x7f7c1057cd53]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x60fbf7)[0x7f7c1057cbf7]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3fd1e0)[0x7f7c1036a1e0]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3fc9c4)[0x7f7c103699c4]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match11check_crate17_4eb7bea3f5c7f29d3_06E+0x439)[0x7f7c1057b3f9]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8c17f6)[0x7f7c1082e7f6]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x908254)[0x7f7c10875254]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6driver6driver12compile_upto17_8d63b5f164a5111b3_06E+0x1d13)[0x7f7c1082a8d3]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x908254)[0x7f7c10875254]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6driver6driver13compile_input15_ec93634a1749fa3_06E+0xb9)[0x7f7c1082ee19]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN12run_compiler16_effc976f5954f613_06E+0x2218)[0x7f7c10860f98]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x905241)[0x7f7c10872241]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x90385e)[0x7f7c1087085e]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x908254)[0x7f7c10875254]<br>
/usr/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xc3d74)[0x7f7c1183ed74]<br>
/usr/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x129dc0)[0x7f7c118a4dc0]<br>
/usr/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7f7c0fd2b754]<br>
error: internal compiler error: unexpected failure<br>
note: the compiler hit an unexpected failure path. this is a bug<br>
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues<br>
rust: task failed at 'explicit failure', .../src/librustc/rustc.rc:371<br>
/usr/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7f7c0fd2aeeb]<br>
/usr/bin/../lib/librustrt.so(+0x2ac29)[0x7f7c0fd3bc29]<br>
/usr/bin/../lib/librustrt.so(upcall_fail+0x180)[0x7f7c0fd2ccf0]<br>
/usr/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xf858b)[0x7f7c1187358b]<br>
/usr/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xf8532)[0x7f7c11873532]<br>
/usr/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(_ZN3sys12begin_unwind17_7cd364c41f10422f3_06E+0x71)[0x7f7c117bb771]<br>
/usr/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x129dc0)[0x7f7c118a4dc0]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN7monitor17_43bc971c43c819df3_06E+0x5fb5)[0x7f7c10867e25]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(+0x908254)[0x7f7c10875254]<br>
/usr/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN4main16_706f4ee7413ae583_06E+0x7e)[0x7f7c10874e6e]<br>
/usr/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7f7c0fd2b754]<br>
rust: domain main @0x19dc3b0 root task failed</p>
<p dir="auto">The following test:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="enum side { mayo, catsup, vinegar }
enum order { hamburger, fries(side), shake }
enum meal { to_go(order), for_here(order) }

fn foo(m: @meal, cond: bool) {
    match *m {
      to_go(_) =&gt; { }
      for_here(_) if cond =&gt; {}
      for_here(hamburger) =&gt; {}
      for_here(fries(s)) =&gt; {}
      for_here(shake) =&gt; {}
    }
}

fn main() {
    foo(@for_here(hamburger), true)
}"><pre class="notranslate"><code class="notranslate">enum side { mayo, catsup, vinegar }
enum order { hamburger, fries(side), shake }
enum meal { to_go(order), for_here(order) }

fn foo(m: @meal, cond: bool) {
    match *m {
      to_go(_) =&gt; { }
      for_here(_) if cond =&gt; {}
      for_here(hamburger) =&gt; {}
      for_here(fries(s)) =&gt; {}
      for_here(shake) =&gt; {}
    }
}

fn main() {
    foo(@for_here(hamburger), true)
}
</code></pre></div>
<p dir="auto">results in an assertion failure in trans:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=";RUST_LOG=rustc=0 rustc ~/tmp/pat-bug-in-trans.rs 
rust: task failed at 'Assertion m.len() &gt; 0u || is_some(chk) failed', /Users/nmatsakis/versioned/rust-gold/src/rustc/middle/trans/alt.rs:431
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=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/nmatsakis/versioned/rust-gold/src/rustc/driver/rustc.rs:264
rust: domain main @0x7f8d99800010 root task failed
rust: task failed at 'killed', /Users/nmatsakis/versioned/rust-gold/src/libcore/task.rs:520"><pre class="notranslate"><code class="notranslate">;RUST_LOG=rustc=0 rustc ~/tmp/pat-bug-in-trans.rs 
rust: task failed at 'Assertion m.len() &gt; 0u || is_some(chk) failed', /Users/nmatsakis/versioned/rust-gold/src/rustc/middle/trans/alt.rs:431
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=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/nmatsakis/versioned/rust-gold/src/rustc/driver/rustc.rs:264
rust: domain main @0x7f8d99800010 root task failed
rust: task failed at 'killed', /Users/nmatsakis/versioned/rust-gold/src/libcore/task.rs:520
</code></pre></div>
<p dir="auto">The problem has to do with the <code class="notranslate">if</code>, something in the logic there gets a bit confused.</p>