about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorTaylor Cramer <cramertaylorj@gmail.com>2017-03-03 14:41:07 -0800
committerTaylor Cramer <cramertaylorj@gmail.com>2017-03-11 22:26:57 -0800
commitea4e8b0a81171d4d6c28a61fa0d1c4d74837bb65 (patch)
tree36847af56a1a93aab1bc9d472c44db14ab6bafe4 /src/test
parentd95c5437222fd63d7b12676bc7916dbeb720f131 (diff)
downloadrust-ea4e8b0a81171d4d6c28a61fa0d1c4d74837bb65.tar.gz
rust-ea4e8b0a81171d4d6c28a61fa0d1c4d74837bb65.zip
Temporarily prefix catch block with do keyword
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/catch-empty-struct-name.rs15
-rw-r--r--src/test/compile-fail/catch-enum-variant.rs17
-rw-r--r--src/test/compile-fail/catch-struct-name.rs15
-rw-r--r--src/test/compile-fail/catch-tuple-struct-name.rs15
-rw-r--r--src/test/compile-fail/feature-gate-catch_expr.rs2
-rw-r--r--src/test/run-pass/catch-expr.rs4
6 files changed, 4 insertions, 64 deletions
diff --git a/src/test/compile-fail/catch-empty-struct-name.rs b/src/test/compile-fail/catch-empty-struct-name.rs
deleted file mode 100644
index 257cb802cc0..00000000000
--- a/src/test/compile-fail/catch-empty-struct-name.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.
-
-#![allow(non_camel_case_types)]
-#![allow(dead_code)]
-#![feature(catch_expr)]
-
-struct catch; //~ ERROR cannot use `catch` as the name of a type
diff --git a/src/test/compile-fail/catch-enum-variant.rs b/src/test/compile-fail/catch-enum-variant.rs
deleted file mode 100644
index 7aa162750d1..00000000000
--- a/src/test/compile-fail/catch-enum-variant.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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.
-
-#![allow(non_camel_case_types)]
-#![allow(dead_code)]
-#![feature(catch_expr)]
-
-enum Enum {
-    catch {} //~ ERROR cannot use `catch` as the name of a type
-}
diff --git a/src/test/compile-fail/catch-struct-name.rs b/src/test/compile-fail/catch-struct-name.rs
deleted file mode 100644
index 63661ccf607..00000000000
--- a/src/test/compile-fail/catch-struct-name.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.
-
-#![allow(non_camel_case_types)]
-#![allow(dead_code)]
-#![feature(catch_expr)]
-
-struct catch {} //~ ERROR cannot use `catch` as the name of a type
\ No newline at end of file
diff --git a/src/test/compile-fail/catch-tuple-struct-name.rs b/src/test/compile-fail/catch-tuple-struct-name.rs
deleted file mode 100644
index 1a8866d8543..00000000000
--- a/src/test/compile-fail/catch-tuple-struct-name.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.
-
-#![allow(non_camel_case_types)]
-#![allow(dead_code)]
-#![feature(catch_expr)]
-
-struct catch(); //~ ERROR cannot use `catch` as the name of a type
diff --git a/src/test/compile-fail/feature-gate-catch_expr.rs b/src/test/compile-fail/feature-gate-catch_expr.rs
index 8a1a5ceae89..5568a5cf0aa 100644
--- a/src/test/compile-fail/feature-gate-catch_expr.rs
+++ b/src/test/compile-fail/feature-gate-catch_expr.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 pub fn main() {
-    let catch_result = catch { //~ ERROR `catch` expression is experimental
+    let catch_result = do catch { //~ ERROR `catch` expression is experimental
         let x = 5;
         x
     };
diff --git a/src/test/run-pass/catch-expr.rs b/src/test/run-pass/catch-expr.rs
index c70b6100efe..a9b28a534a3 100644
--- a/src/test/run-pass/catch-expr.rs
+++ b/src/test/run-pass/catch-expr.rs
@@ -10,8 +10,10 @@
 
 #![feature(catch_expr)]
 
+struct catch {}
+
 pub fn main() {
-    let catch_result = catch {
+    let catch_result = do catch {
         let x = 5;
         x
     };