Rewrite exhaustiveness checker

Issue #352
Closes #1720

The old checker would happily accept things like 'alt x { @some(a) { a } }'.
It now properly descends into patterns, checks exhaustiveness of booleans,
and complains when number/string patterns aren't exhaustive.
This commit is contained in:
Marijn Haverbeke
2012-02-15 09:40:42 +01:00
parent 4b63826050
commit 67cc89f38d
32 changed files with 193 additions and 125 deletions

View File

@@ -241,7 +241,7 @@ fn test_option_int() {
fn deserialize_0<S: deserializer>(s: S) -> option<int> {
s.read_enum("option") {||
s.read_enum_variant {|i|
alt i {
alt check i {
0u { none }
1u {
let v0 = s.read_enum_variant_arg(0u) {||