Add test for non-exhaustive match failure.
This commit is contained in:
parent
b79de6b76c
commit
de9fc72cb4
@ -497,6 +497,7 @@ TEST_XFAILS_LLVM := $(TASK_XFAILS) \
|
||||
explicit-fail.rs \
|
||||
fail.rs \
|
||||
linked-failure.rs \
|
||||
non-exhaustive-match.rs \
|
||||
pred.rs \
|
||||
str-overrun.rs \
|
||||
vec-overrun.rs \
|
||||
|
15
src/test/run-fail/non-exhaustive-match.rs
Normal file
15
src/test/run-fail/non-exhaustive-match.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// -*- rust -*-
|
||||
|
||||
// error-pattern:non-exhaustive match failure
|
||||
|
||||
tag t {
|
||||
a;
|
||||
b;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
auto x = a;
|
||||
alt (x) {
|
||||
case (b) { }
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user