Add test for non-exhaustive match failure.
This commit is contained in:
parent
b79de6b76c
commit
de9fc72cb4
2 changed files with 16 additions and 0 deletions
|
@ -497,6 +497,7 @@ TEST_XFAILS_LLVM := $(TASK_XFAILS) \
|
||||||
explicit-fail.rs \
|
explicit-fail.rs \
|
||||||
fail.rs \
|
fail.rs \
|
||||||
linked-failure.rs \
|
linked-failure.rs \
|
||||||
|
non-exhaustive-match.rs \
|
||||||
pred.rs \
|
pred.rs \
|
||||||
str-overrun.rs \
|
str-overrun.rs \
|
||||||
vec-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…
Add table
Add a link
Reference in a new issue