diff options
| author | Taylor Cramer <cramertaylorj@gmail.com> | 2017-03-06 18:16:57 -0800 |
|---|---|---|
| committer | Taylor Cramer <cramertaylorj@gmail.com> | 2017-03-11 22:26:57 -0800 |
| commit | b1aa99352a69e328094e096bbbd1741b68c0667f (patch) | |
| tree | dc54ebc1cdf86f02d23b35601bbf78ae922284a8 /src | |
| parent | ea4e8b0a81171d4d6c28a61fa0d1c4d74837bb65 (diff) | |
| download | rust-b1aa99352a69e328094e096bbbd1741b68c0667f.tar.gz rust-b1aa99352a69e328094e096bbbd1741b68c0667f.zip | |
Add compile-fail tests for catch expr in match or condition
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/compile-fail/catch-in-match.rs | 15 | ||||
| -rw-r--r-- | src/test/compile-fail/catch-in-while.rs | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/test/compile-fail/catch-in-match.rs b/src/test/compile-fail/catch-in-match.rs new file mode 100644 index 00000000000..9f9968e8124 --- /dev/null +++ b/src/test/compile-fail/catch-in-match.rs @@ -0,0 +1,15 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(catch_expr)] + +fn main() { + match do catch { false } { _ => {} } //~ ERROR expected expression, found reserved keyword `do` +} diff --git a/src/test/compile-fail/catch-in-while.rs b/src/test/compile-fail/catch-in-while.rs new file mode 100644 index 00000000000..cb8613ee60b --- /dev/null +++ b/src/test/compile-fail/catch-in-while.rs @@ -0,0 +1,15 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(catch_expr)] + +fn main() { + while do catch { false } {} //~ ERROR expected expression, found reserved keyword `do` +} |
