Closed
Description
Using a b'x'
literal in a match
in one arm when another arm uses an integral literal causes an ICE.
Code:
pub fn main() {
let (a, b) = (1u8, 2u8);
let _x = match (a, b) {
(0x1b, b'\\') => 1u,
(_, 0x05) => 2u,
_ => 5u
};
}
Results:
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 'compare_list_exprs: type mismatch', /Volumes/Himling/Users/kevin/Dev/rust/rust/src/librustc/middle/trans/_match.rs:236
stack backtrace:
1: 0x10b611c19 - rt::backtrace::imp::write::h49e167be6c35c7a6I3q
2: 0x10b614f71 - failure::on_fail::h2de262f0fa07a6d1mkr
3: 0x10b89c025 - unwind::begin_unwind_inner::h9dd2b45e3189ab76PQd
4: 0x10825d84c - unwind::begin_unwind::h17200107724015028583
5: 0x1086bb033 - middle::trans::_match::Opt<'a>::eq::ha0347177cb74f650KDg
6: 0x1086c7908 - middle::trans::_match::compile_submatch_continue::h2c95eff2a4dfe45ejHh
7: 0x1086c42f0 - middle::trans::_match::compile_submatch::he72af60857c57ca2yBh
8: 0x1086c729f - middle::trans::_match::compile_submatch_continue::h2c95eff2a4dfe45ejHh
9: 0x1086c42f0 - middle::trans::_match::compile_submatch::he72af60857c57ca2yBh
10: 0x10864fb8b - middle::trans::_match::trans_match::h01258bca90f67af8E0h
11: 0x10863cc1c - middle::trans::expr::trans_rvalue_dps_unadjusted::h27302feaf01beb5aZ03
12: 0x1085fe8ed - middle::trans::expr::trans_into::h148e25892fc50848QC2
13: 0x1086d76fe - middle::trans::_match::store_local::closure.127410
14: 0x1086d7565 - middle::trans::_match::mk_binding_alloca::h10952157501536158966
15: 0x1086a375d - middle::trans::_match::store_local::h4bc417dc83908137Xdi
16: 0x1085fde6a - middle::trans::base::init_local::hc06087db4c732c66eYd
17: 0x1085fd331 - middle::trans::controlflow::trans_stmt::h4fb6e8ab2ae05364OEY
18: 0x1085feb98 - middle::trans::controlflow::trans_block::h4903f12a15b4b417UJY
19: 0x1086ac572 - middle::trans::base::trans_closure::hcc72f0bf6b75cf89EPe
20: 0x1085f17f8 - middle::trans::base::trans_fn::h50dd8cb21b7d227f20e
21: 0x1085eec9a - middle::trans::base::trans_item::h2481520530d8b2c5lkf
22: 0x1086b5d78 - middle::trans::base::trans_crate::h2d09203b93180fb4Bkg
23: 0x108abc895 - driver::driver::phase_4_translate_to_llvm::h480b949b4d48af47pJw
24: 0x108ab5613 - driver::driver::compile_input::h7ecbeb2017ef3606rgw
25: 0x108b33b34 - driver::run_compiler::ha722889403f0b6bdn6z
26: 0x108b31d26 - driver::main_args::closure.146118
27: 0x1082949ab - task::TaskBuilder<S>::try_future::closure.101380
28: 0x1082948a3 - task::TaskBuilder<S>::spawn_internal::closure.101351
29: 0x10b4e44bd - task::spawn_opts::closure.8577
30: 0x10b903ecc - rust_try_inner
31: 0x10b903eb6 - rust_try
32: 0x10b899437 - unwind::try::h493476c01d8d39d6xFd
33: 0x10b8992ac - task::Task::run::hd474352d5be20d9fMVc
34: 0x10b4e4312 - task::spawn_opts::closure.8516
35: 0x10b89af6a - thread::thread_start::hf69b37c15c1d48651fd
36: 0x7fff8d29d2fc - _pthread_body
37: 0x7fff8d29d279 - _pthread_body
rustc 0.12.0-pre (496b68d48 2014-09-29 01:03:06 +0000)