Closed
Description
This (broken) code triggers a "the compiler hit an unexpected failure path" warning.
fn main() {
let t = Err(0);
match t {
Some(k) => match k {
a => println!("{}", a)
},
None => ()
}
}
adonohue-mbp:rust-tutorial adonohue$ rustc bugs.rs
bugs.rs:4:5: 4:12 error: mismatched types: expected `std::result::Result<<generic #9>,< generic integer #0>>` but found `std::option::Option<<generic #12>>` (expected enum std::result::Result but found enum std::option::Option)
bugs.rs:4 Some(k) => match k {
^~~~~~~
bugs.rs:7:5: 7:9 error: mismatched types: expected `std::result::Result<<generic #9>,< generic integer #0>>` but found `std::option::Option<<generic #13>>` (expected enum std::result::Result but found enum std::option::Option)
bugs.rs:7 None => ()
^~~~
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement- bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
Ok(task 'rustc' failed at 'index out of bounds: the len is 0 but the index is 0', /Users/adonohue/src/rust/src/librustc/middle/typeck/check/vtable.rs:255
)
Background info:
adonohue-mbp:rust adonohue$ git show --pretty=short
commit c24946e9c68e4543686cf11c392837d4cffea361
Merge: fc1c06d 3950471
Author: bors <[email protected]>
auto merge of #12493 : eddyb/rust/saner-overloads, r=nikomatsakis
adonohue-mbp:rust adonohue$ uname -a
Darwin adonohue-mbp.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64