From de9fc72cb458c28505b2e9c1d4a2bc6d3a4b0986 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 2 Dec 2010 14:50:00 -0800 Subject: Add test for non-exhaustive match failure. --- src/test/run-fail/non-exhaustive-match.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/run-fail/non-exhaustive-match.rs (limited to 'src/test/run-fail') diff --git a/src/test/run-fail/non-exhaustive-match.rs b/src/test/run-fail/non-exhaustive-match.rs new file mode 100644 index 00000000..eb533ef3 --- /dev/null +++ b/src/test/run-fail/non-exhaustive-match.rs @@ -0,0 +1,15 @@ +// -*- rust -*- + +// error-pattern:non-exhaustive match failure + +tag t { + a; + b; +} + +fn main() { + auto x = a; + alt (x) { + case (b) { } + } +} -- cgit v1.2.3