diff options
Diffstat (limited to 'src/test/ui/match/expr-match-panic-fn.rs')
-rw-r--r-- | src/test/ui/match/expr-match-panic-fn.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/match/expr-match-panic-fn.rs b/src/test/ui/match/expr-match-panic-fn.rs new file mode 100644 index 000000000..ea471717e --- /dev/null +++ b/src/test/ui/match/expr-match-panic-fn.rs @@ -0,0 +1,19 @@ +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes + +fn f() -> ! { + panic!() +} + +fn g() -> isize { + let x = match true { + true => f(), + false => 10, + }; + return x; +} + +fn main() { + g(); +} |