diff options
Diffstat (limited to 'tests/ui/expr/if/expr-if-panic.rs')
-rw-r--r-- | tests/ui/expr/if/expr-if-panic.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/expr/if/expr-if-panic.rs b/tests/ui/expr/if/expr-if-panic.rs new file mode 100644 index 000000000..520ee0870 --- /dev/null +++ b/tests/ui/expr/if/expr-if-panic.rs @@ -0,0 +1,13 @@ +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes + +fn main() { + let _x = if false { + 0 + } else if true { + panic!() + } else { + 10 + }; +} |