-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE in match expression #14865
Comments
Minimal test case: enum X {
Foo(uint),
Bar(bool)
}
fn main() {
match Foo(42) {
Foo(..) => (),
_ if true => (),
Bar(..) => fail!("Oh dear")
}
} |
cc @edwardw, sounds related to the trans match code that you were looking at recently |
Indeed. And it seems to be very subtle. The following compiles: enum X {
Foo(uint),
Bar(bool)
}
fn main() {
match Foo(42) {
_ if true => (),
Foo(..) => (),
Bar(..) => fail!("Oh dear")
}
} Although logically two piece of code are different, they should be of little difference as far as |
Closed
edwardw
added a commit
to edwardw/rust
that referenced
this issue
Jun 18, 2014
Fixes a codegen bug which generates illegal non-terminated LLVM block when there are wildcard pattern with guard and enum patterns in a match expression. Also refactors the code a little. Closes rust-lang#14865
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jun 19, 2014
Closes rust-lang#14480 (vim: Add :RustRun and associated commands) Closes rust-lang#14917 (Deprecate free-standing endian conversions in favor of methods on Int. Merge Bitwise into Int and add more bit operations.) Closes rust-lang#14981 (librustc: Use expr_ty_adjusted in trans_overloaded_call.) Closes rust-lang#14989 (std::task - Revamp TaskBuilder API) Closes rust-lang#14997 (Reject double moves out of array elements) Closes rust-lang#14998 (Vim: highlight escapes for byte literals.) Closes rust-lang#15002 (Fix FIXME rust-lang#5275) Closes rust-lang#15004 (Fix rust-lang#14865) Closes rust-lang#15007 (debuginfo: Add test case for issue rust-lang#14411.) Closes rust-lang#15012 ((doc) Change search placeholder text.) Closes rust-lang#15013 (Update compiler-rt.) Closes rust-lang#15017 (Deprecate the bytes!() macro.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following match expression ICEs with
I'm afraid I haven't been able to identify exactly what causes the error, but replacing the
_
withty_uniq(_) | ty_rptr(_, _) | ty_trait(..)
fixes the problem, so the error is there somewhere. The offending match is in coherance.rs.The text was updated successfully, but these errors were encountered: