]> git.lizzy.rs Git - rust.git/commitdiff
test: Rename files, fail -> panic.
authorMichael Sproul <micsproul@gmail.com>
Tue, 11 Nov 2014 17:36:12 +0000 (09:36 -0800)
committerMichael Sproul <micsproul@gmail.com>
Tue, 11 Nov 2014 17:36:12 +0000 (09:36 -0800)
106 files changed:
src/test/run-fail/args-fail.rs [deleted file]
src/test/run-fail/args-panic.rs [new file with mode: 0644]
src/test/run-fail/assert-eq-macro-fail.rs [deleted file]
src/test/run-fail/assert-eq-macro-panic.rs [new file with mode: 0644]
src/test/run-fail/binop-fail.rs [deleted file]
src/test/run-fail/binop-panic.rs [new file with mode: 0644]
src/test/run-fail/doublefail.rs [deleted file]
src/test/run-fail/doublepanic.rs [new file with mode: 0644]
src/test/run-fail/explicit-fail-msg.rs [deleted file]
src/test/run-fail/explicit-fail.rs [deleted file]
src/test/run-fail/explicit-panic-msg.rs [new file with mode: 0644]
src/test/run-fail/explicit-panic.rs [new file with mode: 0644]
src/test/run-fail/expr-fn-fail.rs [deleted file]
src/test/run-fail/expr-fn-panic.rs [new file with mode: 0644]
src/test/run-fail/expr-if-fail-fn.rs [deleted file]
src/test/run-fail/expr-if-fail.rs [deleted file]
src/test/run-fail/expr-if-panic-fn.rs [new file with mode: 0644]
src/test/run-fail/expr-if-panic.rs [new file with mode: 0644]
src/test/run-fail/expr-match-fail-fn.rs [deleted file]
src/test/run-fail/expr-match-fail.rs [deleted file]
src/test/run-fail/expr-match-panic-fn.rs [new file with mode: 0644]
src/test/run-fail/expr-match-panic.rs [new file with mode: 0644]
src/test/run-fail/extern-fail.rs [deleted file]
src/test/run-fail/extern-panic.rs [new file with mode: 0644]
src/test/run-fail/fail-arg.rs [deleted file]
src/test/run-fail/fail-macro-any-wrapped.rs [deleted file]
src/test/run-fail/fail-macro-any.rs [deleted file]
src/test/run-fail/fail-macro-explicit.rs [deleted file]
src/test/run-fail/fail-macro-fmt.rs [deleted file]
src/test/run-fail/fail-macro-owned.rs [deleted file]
src/test/run-fail/fail-macro-static.rs [deleted file]
src/test/run-fail/fail-main.rs [deleted file]
src/test/run-fail/fail-non-utf8.rs [deleted file]
src/test/run-fail/fail-parens.rs [deleted file]
src/test/run-fail/fail-task-name-none.rs [deleted file]
src/test/run-fail/fail-task-name-owned.rs [deleted file]
src/test/run-fail/fail-task-name-send-str.rs [deleted file]
src/test/run-fail/fail-task-name-static.rs [deleted file]
src/test/run-fail/fail.rs [deleted file]
src/test/run-fail/fmt-fail.rs [deleted file]
src/test/run-fail/fmt-panic.rs [new file with mode: 0644]
src/test/run-fail/for-each-loop-fail.rs [deleted file]
src/test/run-fail/for-each-loop-panic.rs [new file with mode: 0644]
src/test/run-fail/if-check-fail.rs [deleted file]
src/test/run-fail/if-check-panic.rs [new file with mode: 0644]
src/test/run-fail/main-fail.rs [deleted file]
src/test/run-fail/main-panic.rs [new file with mode: 0644]
src/test/run-fail/match-bot-fail.rs [deleted file]
src/test/run-fail/match-bot-panic.rs [new file with mode: 0644]
src/test/run-fail/native-failure.rs [deleted file]
src/test/run-fail/native-panic.rs [new file with mode: 0644]
src/test/run-fail/panic-arg.rs [new file with mode: 0644]
src/test/run-fail/panic-macro-any-wrapped.rs [new file with mode: 0644]
src/test/run-fail/panic-macro-any.rs [new file with mode: 0644]
src/test/run-fail/panic-macro-explicit.rs [new file with mode: 0644]
src/test/run-fail/panic-macro-fmt.rs [new file with mode: 0644]
src/test/run-fail/panic-macro-owned.rs [new file with mode: 0644]
src/test/run-fail/panic-macro-static.rs [new file with mode: 0644]
src/test/run-fail/panic-main.rs [new file with mode: 0644]
src/test/run-fail/panic-non-utf8.rs [new file with mode: 0644]
src/test/run-fail/panic-parens.rs [new file with mode: 0644]
src/test/run-fail/panic-task-name-none.rs [new file with mode: 0644]
src/test/run-fail/panic-task-name-owned.rs [new file with mode: 0644]
src/test/run-fail/panic-task-name-send-str.rs [new file with mode: 0644]
src/test/run-fail/panic-task-name-static.rs [new file with mode: 0644]
src/test/run-fail/panic.rs [new file with mode: 0644]
src/test/run-fail/result-get-fail.rs [deleted file]
src/test/run-fail/result-get-panic.rs [new file with mode: 0644]
src/test/run-fail/rt-set-exit-status-fail.rs [deleted file]
src/test/run-fail/rt-set-exit-status-fail2.rs [deleted file]
src/test/run-fail/rt-set-exit-status-panic.rs [new file with mode: 0644]
src/test/run-fail/rt-set-exit-status-panic2.rs [new file with mode: 0644]
src/test/run-fail/test-fail.rs [deleted file]
src/test/run-fail/test-panic.rs [new file with mode: 0644]
src/test/run-fail/unimplemented-macro-fail.rs [deleted file]
src/test/run-fail/unimplemented-macro-panic.rs [new file with mode: 0644]
src/test/run-fail/unique-fail.rs [deleted file]
src/test/run-fail/unique-panic.rs [new file with mode: 0644]
src/test/run-fail/unreachable-macro-fail.rs [deleted file]
src/test/run-fail/unreachable-macro-panic.rs [new file with mode: 0644]
src/test/run-fail/while-body-fails.rs [deleted file]
src/test/run-fail/while-body-panics.rs [new file with mode: 0644]
src/test/run-fail/while-fail.rs [deleted file]
src/test/run-fail/while-panic.rs [new file with mode: 0644]
src/test/run-pass/expr-if-fail-all.rs [deleted file]
src/test/run-pass/expr-if-fail.rs [deleted file]
src/test/run-pass/expr-if-panic-all.rs [new file with mode: 0644]
src/test/run-pass/expr-if-panic.rs [new file with mode: 0644]
src/test/run-pass/expr-match-fail-all.rs [deleted file]
src/test/run-pass/expr-match-fail.rs [deleted file]
src/test/run-pass/expr-match-panic-all.rs [new file with mode: 0644]
src/test/run-pass/expr-match-panic.rs [new file with mode: 0644]
src/test/run-pass/fail-during-tld-destroy.rs [deleted file]
src/test/run-pass/fail-in-dtor-drops-fields.rs [deleted file]
src/test/run-pass/for-loop-fail.rs [deleted file]
src/test/run-pass/for-loop-panic.rs [new file with mode: 0644]
src/test/run-pass/panic-during-tld-destroy.rs [new file with mode: 0644]
src/test/run-pass/panic-in-dtor-drops-fields.rs [new file with mode: 0644]
src/test/run-pass/parse-fail.rs [deleted file]
src/test/run-pass/parse-panic.rs [new file with mode: 0644]
src/test/run-pass/slice-fail-1.rs [deleted file]
src/test/run-pass/slice-fail-2.rs [deleted file]
src/test/run-pass/slice-panic-1.rs [new file with mode: 0644]
src/test/run-pass/slice-panic-2.rs [new file with mode: 0644]
src/test/run-pass/vector-sort-failure-safe.rs [deleted file]
src/test/run-pass/vector-sort-panic-safe.rs [new file with mode: 0644]

diff --git a/src/test/run-fail/args-fail.rs b/src/test/run-fail/args-fail.rs
deleted file mode 100644 (file)
index 4878ec5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 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.
-
-
-// error-pattern:meep
-
-fn f(_a: int, _b: int, _c: Box<int>) { panic!("moop"); }
-
-fn main() { f(1, panic!("meep"), box 42); }
diff --git a/src/test/run-fail/args-panic.rs b/src/test/run-fail/args-panic.rs
new file mode 100644 (file)
index 0000000..4878ec5
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2012 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.
+
+
+// error-pattern:meep
+
+fn f(_a: int, _b: int, _c: Box<int>) { panic!("moop"); }
+
+fn main() { f(1, panic!("meep"), box 42); }
diff --git a/src/test/run-fail/assert-eq-macro-fail.rs b/src/test/run-fail/assert-eq-macro-fail.rs
deleted file mode 100644 (file)
index 69ed025..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2014 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.
-
-// error-pattern:assertion failed: `(left == right) && (right == left)` (left: `14`, right: `15`)
-
-fn main() {
-    assert_eq!(14i,15i);
-}
diff --git a/src/test/run-fail/assert-eq-macro-panic.rs b/src/test/run-fail/assert-eq-macro-panic.rs
new file mode 100644 (file)
index 0000000..69ed025
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2014 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.
+
+// error-pattern:assertion failed: `(left == right) && (right == left)` (left: `14`, right: `15`)
+
+fn main() {
+    assert_eq!(14i,15i);
+}
diff --git a/src/test/run-fail/binop-fail.rs b/src/test/run-fail/binop-fail.rs
deleted file mode 100644 (file)
index ac85b21..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:quux
-fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); }
-fn main() { 3u == my_err("bye".to_string()); }
diff --git a/src/test/run-fail/binop-panic.rs b/src/test/run-fail/binop-panic.rs
new file mode 100644 (file)
index 0000000..ac85b21
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2012 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.
+
+// error-pattern:quux
+fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); }
+fn main() { 3u == my_err("bye".to_string()); }
diff --git a/src/test/run-fail/doublefail.rs b/src/test/run-fail/doublefail.rs
deleted file mode 100644 (file)
index 3835a16..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2012 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(unreachable_code)]
-
-//error-pattern:One
-fn main() {
-    panic!("One");
-    panic!("Two");
-}
diff --git a/src/test/run-fail/doublepanic.rs b/src/test/run-fail/doublepanic.rs
new file mode 100644 (file)
index 0000000..3835a16
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2012 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(unreachable_code)]
+
+//error-pattern:One
+fn main() {
+    panic!("One");
+    panic!("Two");
+}
diff --git a/src/test/run-fail/explicit-fail-msg.rs b/src/test/run-fail/explicit-fail-msg.rs
deleted file mode 100644 (file)
index ae6e72b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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(unused_assignments)]
-#![allow(unused_variables)]
-
-// error-pattern:wooooo
-fn main() {
-    let mut a = 1i;
-    if 1i == 1 { a = 2; }
-    panic!(format!("woooo{}", "o"));
-}
diff --git a/src/test/run-fail/explicit-fail.rs b/src/test/run-fail/explicit-fail.rs
deleted file mode 100644 (file)
index 4699897..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 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.
-
-
-
-
-// error-pattern:explicit
-fn main() { panic!(); }
diff --git a/src/test/run-fail/explicit-panic-msg.rs b/src/test/run-fail/explicit-panic-msg.rs
new file mode 100644 (file)
index 0000000..ae6e72b
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2012 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(unused_assignments)]
+#![allow(unused_variables)]
+
+// error-pattern:wooooo
+fn main() {
+    let mut a = 1i;
+    if 1i == 1 { a = 2; }
+    panic!(format!("woooo{}", "o"));
+}
diff --git a/src/test/run-fail/explicit-panic.rs b/src/test/run-fail/explicit-panic.rs
new file mode 100644 (file)
index 0000000..4699897
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2012 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.
+
+
+
+
+// error-pattern:explicit
+fn main() { panic!(); }
diff --git a/src/test/run-fail/expr-fn-fail.rs b/src/test/run-fail/expr-fn-fail.rs
deleted file mode 100644 (file)
index 8cf018f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:explicit panic
-
-fn f() -> ! { panic!() }
-
-fn main() { f(); }
diff --git a/src/test/run-fail/expr-fn-panic.rs b/src/test/run-fail/expr-fn-panic.rs
new file mode 100644 (file)
index 0000000..8cf018f
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2012 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.
+
+// error-pattern:explicit panic
+
+fn f() -> ! { panic!() }
+
+fn main() { f(); }
diff --git a/src/test/run-fail/expr-if-fail-fn.rs b/src/test/run-fail/expr-if-fail-fn.rs
deleted file mode 100644 (file)
index 987bee5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:explicit panic
-
-fn f() -> ! { panic!() }
-
-fn g() -> int { let x = if true { f() } else { 10 }; return x; }
-
-fn main() { g(); }
diff --git a/src/test/run-fail/expr-if-fail.rs b/src/test/run-fail/expr-if-fail.rs
deleted file mode 100644 (file)
index f04c94a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:explicit panic
-
-fn main() { let _x = if false { 0i } else if true { panic!() } else { 10i }; }
diff --git a/src/test/run-fail/expr-if-panic-fn.rs b/src/test/run-fail/expr-if-panic-fn.rs
new file mode 100644 (file)
index 0000000..987bee5
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2012 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.
+
+// error-pattern:explicit panic
+
+fn f() -> ! { panic!() }
+
+fn g() -> int { let x = if true { f() } else { 10 }; return x; }
+
+fn main() { g(); }
diff --git a/src/test/run-fail/expr-if-panic.rs b/src/test/run-fail/expr-if-panic.rs
new file mode 100644 (file)
index 0000000..f04c94a
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2012 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.
+
+// error-pattern:explicit panic
+
+fn main() { let _x = if false { 0i } else if true { panic!() } else { 10i }; }
diff --git a/src/test/run-fail/expr-match-fail-fn.rs b/src/test/run-fail/expr-match-fail-fn.rs
deleted file mode 100644 (file)
index 069c1d5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:explicit panic
-
-fn f() -> ! { panic!() }
-
-fn g() -> int { let x = match true { true => { f() } false => { 10 } }; return x; }
-
-fn main() { g(); }
diff --git a/src/test/run-fail/expr-match-fail.rs b/src/test/run-fail/expr-match-fail.rs
deleted file mode 100644 (file)
index d5c005b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:explicit panic
-
-fn main() { let _x = match true { false => { 0i } true => { panic!() } }; }
diff --git a/src/test/run-fail/expr-match-panic-fn.rs b/src/test/run-fail/expr-match-panic-fn.rs
new file mode 100644 (file)
index 0000000..069c1d5
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2012 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.
+
+// error-pattern:explicit panic
+
+fn f() -> ! { panic!() }
+
+fn g() -> int { let x = match true { true => { f() } false => { 10 } }; return x; }
+
+fn main() { g(); }
diff --git a/src/test/run-fail/expr-match-panic.rs b/src/test/run-fail/expr-match-panic.rs
new file mode 100644 (file)
index 0000000..d5c005b
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2012 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.
+
+// error-pattern:explicit panic
+
+fn main() { let _x = match true { false => { 0i } true => { panic!() } }; }
diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs
deleted file mode 100644 (file)
index 21a332a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2012-2014 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.
-
-// ignore-test linked failure
-// error-pattern:explicit failure
-// Testing that runtime failure doesn't cause callbacks to abort abnormally.
-// Instead the failure will be delivered after the callbacks return.
-
-extern crate libc;
-use std::task;
-
-mod rustrt {
-    extern crate libc;
-
-    extern {
-        pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
-                             -> libc::uintptr_t;
-    }
-}
-
-extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t {
-    if data == 1u {
-        data
-    } else {
-        count(data - 1u) + count(data - 1u)
-    }
-}
-
-fn count(n: uint) -> uint {
-    unsafe {
-        task::deschedule();
-        rustrt::rust_dbg_call(cb, n)
-    }
-}
-
-fn main() {
-    for _ in range(0, 10u) {
-        task::spawn(proc() {
-            let result = count(5u);
-            println!("result = %?", result);
-            panic!();
-        });
-    }
-}
diff --git a/src/test/run-fail/extern-panic.rs b/src/test/run-fail/extern-panic.rs
new file mode 100644 (file)
index 0000000..21a332a
--- /dev/null
@@ -0,0 +1,51 @@
+// Copyright 2012-2014 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.
+
+// ignore-test linked failure
+// error-pattern:explicit failure
+// Testing that runtime failure doesn't cause callbacks to abort abnormally.
+// Instead the failure will be delivered after the callbacks return.
+
+extern crate libc;
+use std::task;
+
+mod rustrt {
+    extern crate libc;
+
+    extern {
+        pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
+                             -> libc::uintptr_t;
+    }
+}
+
+extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t {
+    if data == 1u {
+        data
+    } else {
+        count(data - 1u) + count(data - 1u)
+    }
+}
+
+fn count(n: uint) -> uint {
+    unsafe {
+        task::deschedule();
+        rustrt::rust_dbg_call(cb, n)
+    }
+}
+
+fn main() {
+    for _ in range(0, 10u) {
+        task::spawn(proc() {
+            let result = count(5u);
+            println!("result = %?", result);
+            panic!();
+        });
+    }
+}
diff --git a/src/test/run-fail/fail-arg.rs b/src/test/run-fail/fail-arg.rs
deleted file mode 100644 (file)
index 4d4f931..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:woe
-fn f(a: int) { println!("{}", a); }
-
-fn main() { f(panic!("woe")); }
diff --git a/src/test/run-fail/fail-macro-any-wrapped.rs b/src/test/run-fail/fail-macro-any-wrapped.rs
deleted file mode 100644 (file)
index e25390a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:panicked at 'Box<Any>'
-
-fn main() {
-    panic!(box 612_i64);
-}
diff --git a/src/test/run-fail/fail-macro-any.rs b/src/test/run-fail/fail-macro-any.rs
deleted file mode 100644 (file)
index b73c66c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:panicked at 'Box<Any>'
-
-fn main() {
-    panic!(box 413i as Box<::std::any::Any+Send>);
-}
diff --git a/src/test/run-fail/fail-macro-explicit.rs b/src/test/run-fail/fail-macro-explicit.rs
deleted file mode 100644 (file)
index a856554..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:panicked at 'explicit panic'
-
-fn main() {
-    panic!();
-}
diff --git a/src/test/run-fail/fail-macro-fmt.rs b/src/test/run-fail/fail-macro-fmt.rs
deleted file mode 100644 (file)
index ac50f02..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:panicked at 'test-fail-fmt 42 rust'
-
-fn main() {
-    panic!("test-fail-fmt {} {}", 42i, "rust");
-}
diff --git a/src/test/run-fail/fail-macro-owned.rs b/src/test/run-fail/fail-macro-owned.rs
deleted file mode 100644 (file)
index 2f695c4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:panicked at 'test-fail-owned'
-
-fn main() {
-    panic!("test-fail-owned");
-}
diff --git a/src/test/run-fail/fail-macro-static.rs b/src/test/run-fail/fail-macro-static.rs
deleted file mode 100644 (file)
index c62162d..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:panicked at 'test-fail-static'
-
-fn main() {
-    panic!("test-fail-static");
-}
diff --git a/src/test/run-fail/fail-main.rs b/src/test/run-fail/fail-main.rs
deleted file mode 100644 (file)
index 877ea9c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:moop
-fn main() { panic!("moop"); }
diff --git a/src/test/run-fail/fail-non-utf8.rs b/src/test/run-fail/fail-non-utf8.rs
deleted file mode 100644 (file)
index 8b01319..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-
-// Copyright 2013 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.
-
-// Previously failed formating invalid utf8.
-// cc #16877
-
-// error-pattern:panicked at 'hello�'
-
-struct Foo;
-impl std::fmt::Show for Foo {
-    fn fmt(&self, fmtr:&mut std::fmt::Formatter) -> std::fmt::Result {
-        // Purge invalid utf8: 0xff
-        fmtr.write(&[104, 101, 108, 108, 111, 0xff])
-    }
-}
-fn main() {
-    panic!("{}", Foo)
-}
diff --git a/src/test/run-fail/fail-parens.rs b/src/test/run-fail/fail-parens.rs
deleted file mode 100644 (file)
index 06655e4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 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.
-
-// Fail macros without arguments need to be disambiguated in
-// certain positions
-// error-pattern:oops
-
-fn bigpanic() {
-    while (panic!("oops")) { if (panic!()) {
-        match (panic!()) { () => {
-        }
-                     }
-    }};
-}
-
-fn main() { bigpanic(); }
diff --git a/src/test/run-fail/fail-task-name-none.rs b/src/test/run-fail/fail-task-name-none.rs
deleted file mode 100644 (file)
index 3f8abc4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:task '<unnamed>' panicked at 'test'
-
-use std::task;
-
-fn main() {
-    let r: Result<int,_> = task::try(proc() {
-        panic!("test");
-        1i
-    });
-    assert!(r.is_ok());
-}
diff --git a/src/test/run-fail/fail-task-name-owned.rs b/src/test/run-fail/fail-task-name-owned.rs
deleted file mode 100644 (file)
index 0a30347..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:task 'owned name' panicked at 'test'
-
-use std::task::TaskBuilder;
-
-fn main() {
-    let r: Result<int,_> = TaskBuilder::new().named("owned name".to_string())
-                                             .try(proc() {
-        panic!("test");
-        1i
-    });
-    assert!(r.is_ok());
-}
diff --git a/src/test/run-fail/fail-task-name-send-str.rs b/src/test/run-fail/fail-task-name-send-str.rs
deleted file mode 100644 (file)
index 73fca24..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:task 'send name' panicked at 'test'
-
-fn main() {
-    let r: Result<int,_> =
-        ::std::task::TaskBuilder::new().named("send name".into_maybe_owned())
-                                       .try(proc() {
-            panic!("test");
-            3i
-        });
-    assert!(r.is_ok());
-}
diff --git a/src/test/run-fail/fail-task-name-static.rs b/src/test/run-fail/fail-task-name-static.rs
deleted file mode 100644 (file)
index 21c019e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:task 'static name' panicked at 'test'
-
-fn main() {
-    let r: Result<int,_> =
-        ::std::task::TaskBuilder::new().named("static name").try(proc() {
-            panic!("test");
-        });
-    assert!(r.is_ok());
-}
diff --git a/src/test/run-fail/fail.rs b/src/test/run-fail/fail.rs
deleted file mode 100644 (file)
index 54ccc98..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 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.
-
-
-
-
-// error-pattern:1i == 2
-fn main() { assert!((1i == 2)); }
diff --git a/src/test/run-fail/fmt-fail.rs b/src/test/run-fail/fmt-fail.rs
deleted file mode 100644 (file)
index 22e8148..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:meh
-
-fn main() {
-    let str_var: String = "meh".to_string();
-    panic!("{}", str_var);
-}
diff --git a/src/test/run-fail/fmt-panic.rs b/src/test/run-fail/fmt-panic.rs
new file mode 100644 (file)
index 0000000..22e8148
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2012 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.
+
+// error-pattern:meh
+
+fn main() {
+    let str_var: String = "meh".to_string();
+    panic!("{}", str_var);
+}
diff --git a/src/test/run-fail/for-each-loop-fail.rs b/src/test/run-fail/for-each-loop-fail.rs
deleted file mode 100644 (file)
index 472c8ae..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:moop
-
-fn main() { for _ in range(0u, 10u) { panic!("moop"); } }
diff --git a/src/test/run-fail/for-each-loop-panic.rs b/src/test/run-fail/for-each-loop-panic.rs
new file mode 100644 (file)
index 0000000..472c8ae
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2012 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.
+
+// error-pattern:moop
+
+fn main() { for _ in range(0u, 10u) { panic!("moop"); } }
diff --git a/src/test/run-fail/if-check-fail.rs b/src/test/run-fail/if-check-fail.rs
deleted file mode 100644 (file)
index 1ead81b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:Number is odd
-fn even(x: uint) -> bool {
-    if x < 2u {
-        return false;
-    } else if x == 2u { return true; } else { return even(x - 2u); }
-}
-
-fn foo(x: uint) {
-    if even(x) {
-        println!("{}", x);
-    } else {
-        panic!("Number is odd");
-    }
-}
-
-fn main() { foo(3u); }
diff --git a/src/test/run-fail/if-check-panic.rs b/src/test/run-fail/if-check-panic.rs
new file mode 100644 (file)
index 0000000..1ead81b
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright 2012 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.
+
+// error-pattern:Number is odd
+fn even(x: uint) -> bool {
+    if x < 2u {
+        return false;
+    } else if x == 2u { return true; } else { return even(x - 2u); }
+}
+
+fn foo(x: uint) {
+    if even(x) {
+        println!("{}", x);
+    } else {
+        panic!("Number is odd");
+    }
+}
+
+fn main() { foo(3u); }
diff --git a/src/test/run-fail/main-fail.rs b/src/test/run-fail/main-fail.rs
deleted file mode 100644 (file)
index b750501..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:task '<main>' panicked at
-
-fn main() {
-    panic!()
-}
diff --git a/src/test/run-fail/main-panic.rs b/src/test/run-fail/main-panic.rs
new file mode 100644 (file)
index 0000000..b750501
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+// error-pattern:task '<main>' panicked at
+
+fn main() {
+    panic!()
+}
diff --git a/src/test/run-fail/match-bot-fail.rs b/src/test/run-fail/match-bot-fail.rs
deleted file mode 100644 (file)
index 2b1672a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern:explicit panic
-
-#![allow(unreachable_code)]
-#![allow(unused_variables)]
-
-fn foo(s: String) { }
-
-fn main() {
-    let i =
-        match Some::<int>(3) { None::<int> => { panic!() } Some::<int>(_) => { panic!() } };
-    foo(i);
-}
diff --git a/src/test/run-fail/match-bot-panic.rs b/src/test/run-fail/match-bot-panic.rs
new file mode 100644 (file)
index 0000000..2b1672a
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2012 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.
+
+// error-pattern:explicit panic
+
+#![allow(unreachable_code)]
+#![allow(unused_variables)]
+
+fn foo(s: String) { }
+
+fn main() {
+    let i =
+        match Some::<int>(3) { None::<int> => { panic!() } Some::<int>(_) => { panic!() } };
+    foo(i);
+}
diff --git a/src/test/run-fail/native-failure.rs b/src/test/run-fail/native-failure.rs
deleted file mode 100644 (file)
index 0b26167..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2014 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.
-
-// ignore-android (FIXME #11419)
-// error-pattern:explicit panic
-
-extern crate native;
-
-#[start]
-fn start(argc: int, argv: *const *const u8) -> int {
-    native::start(argc, argv, proc() {
-        panic!();
-    })
-}
diff --git a/src/test/run-fail/native-panic.rs b/src/test/run-fail/native-panic.rs
new file mode 100644 (file)
index 0000000..0b26167
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2014 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.
+
+// ignore-android (FIXME #11419)
+// error-pattern:explicit panic
+
+extern crate native;
+
+#[start]
+fn start(argc: int, argv: *const *const u8) -> int {
+    native::start(argc, argv, proc() {
+        panic!();
+    })
+}
diff --git a/src/test/run-fail/panic-arg.rs b/src/test/run-fail/panic-arg.rs
new file mode 100644 (file)
index 0000000..4d4f931
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2012 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.
+
+// error-pattern:woe
+fn f(a: int) { println!("{}", a); }
+
+fn main() { f(panic!("woe")); }
diff --git a/src/test/run-fail/panic-macro-any-wrapped.rs b/src/test/run-fail/panic-macro-any-wrapped.rs
new file mode 100644 (file)
index 0000000..e25390a
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+// error-pattern:panicked at 'Box<Any>'
+
+fn main() {
+    panic!(box 612_i64);
+}
diff --git a/src/test/run-fail/panic-macro-any.rs b/src/test/run-fail/panic-macro-any.rs
new file mode 100644 (file)
index 0000000..b73c66c
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+// error-pattern:panicked at 'Box<Any>'
+
+fn main() {
+    panic!(box 413i as Box<::std::any::Any+Send>);
+}
diff --git a/src/test/run-fail/panic-macro-explicit.rs b/src/test/run-fail/panic-macro-explicit.rs
new file mode 100644 (file)
index 0000000..a856554
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+// error-pattern:panicked at 'explicit panic'
+
+fn main() {
+    panic!();
+}
diff --git a/src/test/run-fail/panic-macro-fmt.rs b/src/test/run-fail/panic-macro-fmt.rs
new file mode 100644 (file)
index 0000000..ac50f02
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+// error-pattern:panicked at 'test-fail-fmt 42 rust'
+
+fn main() {
+    panic!("test-fail-fmt {} {}", 42i, "rust");
+}
diff --git a/src/test/run-fail/panic-macro-owned.rs b/src/test/run-fail/panic-macro-owned.rs
new file mode 100644 (file)
index 0000000..2f695c4
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+// error-pattern:panicked at 'test-fail-owned'
+
+fn main() {
+    panic!("test-fail-owned");
+}
diff --git a/src/test/run-fail/panic-macro-static.rs b/src/test/run-fail/panic-macro-static.rs
new file mode 100644 (file)
index 0000000..c62162d
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+// error-pattern:panicked at 'test-fail-static'
+
+fn main() {
+    panic!("test-fail-static");
+}
diff --git a/src/test/run-fail/panic-main.rs b/src/test/run-fail/panic-main.rs
new file mode 100644 (file)
index 0000000..877ea9c
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2012 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.
+
+// error-pattern:moop
+fn main() { panic!("moop"); }
diff --git a/src/test/run-fail/panic-non-utf8.rs b/src/test/run-fail/panic-non-utf8.rs
new file mode 100644 (file)
index 0000000..8b01319
--- /dev/null
@@ -0,0 +1,26 @@
+
+// Copyright 2013 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.
+
+// Previously failed formating invalid utf8.
+// cc #16877
+
+// error-pattern:panicked at 'hello�'
+
+struct Foo;
+impl std::fmt::Show for Foo {
+    fn fmt(&self, fmtr:&mut std::fmt::Formatter) -> std::fmt::Result {
+        // Purge invalid utf8: 0xff
+        fmtr.write(&[104, 101, 108, 108, 111, 0xff])
+    }
+}
+fn main() {
+    panic!("{}", Foo)
+}
diff --git a/src/test/run-fail/panic-parens.rs b/src/test/run-fail/panic-parens.rs
new file mode 100644 (file)
index 0000000..06655e4
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright 2012 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.
+
+// Fail macros without arguments need to be disambiguated in
+// certain positions
+// error-pattern:oops
+
+fn bigpanic() {
+    while (panic!("oops")) { if (panic!()) {
+        match (panic!()) { () => {
+        }
+                     }
+    }};
+}
+
+fn main() { bigpanic(); }
diff --git a/src/test/run-fail/panic-task-name-none.rs b/src/test/run-fail/panic-task-name-none.rs
new file mode 100644 (file)
index 0000000..3f8abc4
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2013 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.
+
+// error-pattern:task '<unnamed>' panicked at 'test'
+
+use std::task;
+
+fn main() {
+    let r: Result<int,_> = task::try(proc() {
+        panic!("test");
+        1i
+    });
+    assert!(r.is_ok());
+}
diff --git a/src/test/run-fail/panic-task-name-owned.rs b/src/test/run-fail/panic-task-name-owned.rs
new file mode 100644 (file)
index 0000000..0a30347
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2013 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.
+
+// error-pattern:task 'owned name' panicked at 'test'
+
+use std::task::TaskBuilder;
+
+fn main() {
+    let r: Result<int,_> = TaskBuilder::new().named("owned name".to_string())
+                                             .try(proc() {
+        panic!("test");
+        1i
+    });
+    assert!(r.is_ok());
+}
diff --git a/src/test/run-fail/panic-task-name-send-str.rs b/src/test/run-fail/panic-task-name-send-str.rs
new file mode 100644 (file)
index 0000000..73fca24
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2013 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.
+
+// error-pattern:task 'send name' panicked at 'test'
+
+fn main() {
+    let r: Result<int,_> =
+        ::std::task::TaskBuilder::new().named("send name".into_maybe_owned())
+                                       .try(proc() {
+            panic!("test");
+            3i
+        });
+    assert!(r.is_ok());
+}
diff --git a/src/test/run-fail/panic-task-name-static.rs b/src/test/run-fail/panic-task-name-static.rs
new file mode 100644 (file)
index 0000000..21c019e
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2013 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.
+
+// error-pattern:task 'static name' panicked at 'test'
+
+fn main() {
+    let r: Result<int,_> =
+        ::std::task::TaskBuilder::new().named("static name").try(proc() {
+            panic!("test");
+        });
+    assert!(r.is_ok());
+}
diff --git a/src/test/run-fail/panic.rs b/src/test/run-fail/panic.rs
new file mode 100644 (file)
index 0000000..54ccc98
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2012 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.
+
+
+
+
+// error-pattern:1i == 2
+fn main() { assert!((1i == 2)); }
diff --git a/src/test/run-fail/result-get-fail.rs b/src/test/run-fail/result-get-fail.rs
deleted file mode 100644 (file)
index 6098b97..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2013 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.
-
-// error-pattern:called `Result::unwrap()` on an `Err` value
-
-use std::result;
-
-fn main() {
-    println!("{}", result::Err::<int,String>("kitty".to_string()).unwrap());
-}
diff --git a/src/test/run-fail/result-get-panic.rs b/src/test/run-fail/result-get-panic.rs
new file mode 100644 (file)
index 0000000..6098b97
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2013 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.
+
+// error-pattern:called `Result::unwrap()` on an `Err` value
+
+use std::result;
+
+fn main() {
+    println!("{}", result::Err::<int,String>("kitty".to_string()).unwrap());
+}
diff --git a/src/test/run-fail/rt-set-exit-status-fail.rs b/src/test/run-fail/rt-set-exit-status-fail.rs
deleted file mode 100644 (file)
index e524a24..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2012-2014 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.
-
-// error-pattern:whatever
-
-#![feature(phase)]
-#[phase(plugin, link)] extern crate log;
-use std::os;
-
-fn main() {
-    error!("whatever");
-    // Setting the exit status only works when the scheduler terminates
-    // normally. In this case we're going to panic, so instead of
-    // returning 50 the process will return the typical rt failure code.
-    os::set_exit_status(50);
-    panic!();
-}
diff --git a/src/test/run-fail/rt-set-exit-status-fail2.rs b/src/test/run-fail/rt-set-exit-status-fail2.rs
deleted file mode 100644 (file)
index 1cfc6c3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2012-2014 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.
-
-// error-pattern:whatever
-
-#![feature(phase)]
-#[phase(plugin, link)] extern crate log;
-use std::os;
-use std::task;
-
-struct r {
-  x:int,
-}
-
-// Setting the exit status after the runtime has already
-// panicked has no effect and the process exits with the
-// runtime's exit code
-impl Drop for r {
-    fn drop(&mut self) {
-        os::set_exit_status(50);
-    }
-}
-
-fn r(x:int) -> r {
-    r {
-        x: x
-    }
-}
-
-fn main() {
-    error!("whatever");
-    task::spawn(proc() {
-      let _i = r(5);
-    });
-    panic!();
-}
diff --git a/src/test/run-fail/rt-set-exit-status-panic.rs b/src/test/run-fail/rt-set-exit-status-panic.rs
new file mode 100644 (file)
index 0000000..e524a24
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright 2012-2014 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.
+
+// error-pattern:whatever
+
+#![feature(phase)]
+#[phase(plugin, link)] extern crate log;
+use std::os;
+
+fn main() {
+    error!("whatever");
+    // Setting the exit status only works when the scheduler terminates
+    // normally. In this case we're going to panic, so instead of
+    // returning 50 the process will return the typical rt failure code.
+    os::set_exit_status(50);
+    panic!();
+}
diff --git a/src/test/run-fail/rt-set-exit-status-panic2.rs b/src/test/run-fail/rt-set-exit-status-panic2.rs
new file mode 100644 (file)
index 0000000..1cfc6c3
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright 2012-2014 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.
+
+// error-pattern:whatever
+
+#![feature(phase)]
+#[phase(plugin, link)] extern crate log;
+use std::os;
+use std::task;
+
+struct r {
+  x:int,
+}
+
+// Setting the exit status after the runtime has already
+// panicked has no effect and the process exits with the
+// runtime's exit code
+impl Drop for r {
+    fn drop(&mut self) {
+        os::set_exit_status(50);
+    }
+}
+
+fn r(x:int) -> r {
+    r {
+        x: x
+    }
+}
+
+fn main() {
+    error!("whatever");
+    task::spawn(proc() {
+      let _i = r(5);
+    });
+    panic!();
+}
diff --git a/src/test/run-fail/test-fail.rs b/src/test/run-fail/test-fail.rs
deleted file mode 100644 (file)
index cd2ec83..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2013 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.
-
-// check-stdout
-// error-pattern:task 'test_foo' panicked at
-// compile-flags: --test
-// ignore-pretty: does not work well with `--test`
-
-#[test]
-fn test_foo() {
-    panic!()
-}
-
diff --git a/src/test/run-fail/test-panic.rs b/src/test/run-fail/test-panic.rs
new file mode 100644 (file)
index 0000000..cd2ec83
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2013 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.
+
+// check-stdout
+// error-pattern:task 'test_foo' panicked at
+// compile-flags: --test
+// ignore-pretty: does not work well with `--test`
+
+#[test]
+fn test_foo() {
+    panic!()
+}
+
diff --git a/src/test/run-fail/unimplemented-macro-fail.rs b/src/test/run-fail/unimplemented-macro-fail.rs
deleted file mode 100644 (file)
index 7eff1fe..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2014 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.
-
-// error-pattern:not yet implemented
-fn main() { unimplemented!() }
diff --git a/src/test/run-fail/unimplemented-macro-panic.rs b/src/test/run-fail/unimplemented-macro-panic.rs
new file mode 100644 (file)
index 0000000..7eff1fe
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2014 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.
+
+// error-pattern:not yet implemented
+fn main() { unimplemented!() }
diff --git a/src/test/run-fail/unique-fail.rs b/src/test/run-fail/unique-fail.rs
deleted file mode 100644 (file)
index 07c9a21..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern: panic
-fn main() { box panic!(); }
diff --git a/src/test/run-fail/unique-panic.rs b/src/test/run-fail/unique-panic.rs
new file mode 100644 (file)
index 0000000..07c9a21
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2012 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.
+
+// error-pattern: panic
+fn main() { box panic!(); }
diff --git a/src/test/run-fail/unreachable-macro-fail.rs b/src/test/run-fail/unreachable-macro-fail.rs
deleted file mode 100644 (file)
index 07e05c6..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2014 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.
-
-// error-pattern:internal error: entered unreachable code
-fn main() { unreachable!() }
diff --git a/src/test/run-fail/unreachable-macro-panic.rs b/src/test/run-fail/unreachable-macro-panic.rs
new file mode 100644 (file)
index 0000000..07e05c6
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2014 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.
+
+// error-pattern:internal error: entered unreachable code
+fn main() { unreachable!() }
diff --git a/src/test/run-fail/while-body-fails.rs b/src/test/run-fail/while-body-fails.rs
deleted file mode 100644 (file)
index 6a7d0a1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2012 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(while_true)]
-
-// error-pattern:quux
-fn main() { let _x: int = { while true { panic!("quux"); } ; 8 } ; }
diff --git a/src/test/run-fail/while-body-panics.rs b/src/test/run-fail/while-body-panics.rs
new file mode 100644 (file)
index 0000000..6a7d0a1
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2012 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(while_true)]
+
+// error-pattern:quux
+fn main() { let _x: int = { while true { panic!("quux"); } ; 8 } ; }
diff --git a/src/test/run-fail/while-fail.rs b/src/test/run-fail/while-fail.rs
deleted file mode 100644 (file)
index f6081e4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 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(while_true)]
-
-// error-pattern:giraffe
-fn main() {
-    panic!({ while true { panic!("giraffe") }; "clandestine" });
-}
diff --git a/src/test/run-fail/while-panic.rs b/src/test/run-fail/while-panic.rs
new file mode 100644 (file)
index 0000000..f6081e4
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2012 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(while_true)]
+
+// error-pattern:giraffe
+fn main() {
+    panic!({ while true { panic!("giraffe") }; "clandestine" });
+}
diff --git a/src/test/run-pass/expr-if-fail-all.rs b/src/test/run-pass/expr-if-fail-all.rs
deleted file mode 100644 (file)
index 0dd7ddc..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-// When all branches of an if expression result in panic, the entire if
-// expression results in panic.
-pub fn main() {
-    let _x = if true {
-        10i
-    } else {
-        if true { panic!() } else { panic!() }
-    };
-}
diff --git a/src/test/run-pass/expr-if-fail.rs b/src/test/run-pass/expr-if-fail.rs
deleted file mode 100644 (file)
index aa4240c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 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.
-
-fn test_if_panic() {
-    let x = if false { panic!() } else { 10i };
-    assert!((x == 10));
-}
-
-fn test_else_panic() {
-    let x = if true { 10i } else { panic!() };
-    assert_eq!(x, 10i);
-}
-
-fn test_elseif_panic() {
-    let x = if false { 0i } else if false { panic!() } else { 10i };
-    assert_eq!(x, 10i);
-}
-
-pub fn main() { test_if_panic(); test_else_panic(); test_elseif_panic(); }
diff --git a/src/test/run-pass/expr-if-panic-all.rs b/src/test/run-pass/expr-if-panic-all.rs
new file mode 100644 (file)
index 0000000..0dd7ddc
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2012 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.
+
+// When all branches of an if expression result in panic, the entire if
+// expression results in panic.
+pub fn main() {
+    let _x = if true {
+        10i
+    } else {
+        if true { panic!() } else { panic!() }
+    };
+}
diff --git a/src/test/run-pass/expr-if-panic.rs b/src/test/run-pass/expr-if-panic.rs
new file mode 100644 (file)
index 0000000..aa4240c
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright 2012 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.
+
+fn test_if_panic() {
+    let x = if false { panic!() } else { 10i };
+    assert!((x == 10));
+}
+
+fn test_else_panic() {
+    let x = if true { 10i } else { panic!() };
+    assert_eq!(x, 10i);
+}
+
+fn test_elseif_panic() {
+    let x = if false { 0i } else if false { panic!() } else { 10i };
+    assert_eq!(x, 10i);
+}
+
+pub fn main() { test_if_panic(); test_else_panic(); test_elseif_panic(); }
diff --git a/src/test/run-pass/expr-match-fail-all.rs b/src/test/run-pass/expr-match-fail-all.rs
deleted file mode 100644 (file)
index 3b33c18..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012-2014 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.
-
-
-
-
-// When all branches of a match expression result in panic, the entire
-// match expression results in panic.
-pub fn main() {
-    let _x =
-        match true {
-          true => { 10i }
-          false => { match true { true => { panic!() } false => { panic!() } } }
-        };
-}
diff --git a/src/test/run-pass/expr-match-fail.rs b/src/test/run-pass/expr-match-fail.rs
deleted file mode 100644 (file)
index d8ee21d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012 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.
-
-
-fn test_simple() {
-    let r = match true { true => { true } false => { panic!() } };
-    assert_eq!(r, true);
-}
-
-fn test_box() {
-    let r = match true { true => { vec!(10i) } false => { panic!() } };
-    assert_eq!(r[0], 10i);
-}
-
-pub fn main() { test_simple(); test_box(); }
diff --git a/src/test/run-pass/expr-match-panic-all.rs b/src/test/run-pass/expr-match-panic-all.rs
new file mode 100644 (file)
index 0000000..3b33c18
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2012-2014 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.
+
+
+
+
+// When all branches of a match expression result in panic, the entire
+// match expression results in panic.
+pub fn main() {
+    let _x =
+        match true {
+          true => { 10i }
+          false => { match true { true => { panic!() } false => { panic!() } } }
+        };
+}
diff --git a/src/test/run-pass/expr-match-panic.rs b/src/test/run-pass/expr-match-panic.rs
new file mode 100644 (file)
index 0000000..d8ee21d
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2012 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.
+
+
+fn test_simple() {
+    let r = match true { true => { true } false => { panic!() } };
+    assert_eq!(r, true);
+}
+
+fn test_box() {
+    let r = match true { true => { vec!(10i) } false => { panic!() } };
+    assert_eq!(r[0], 10i);
+}
+
+pub fn main() { test_simple(); test_box(); }
diff --git a/src/test/run-pass/fail-during-tld-destroy.rs b/src/test/run-pass/fail-during-tld-destroy.rs
deleted file mode 100644 (file)
index 2f0d6cf..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2014 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.
-
-use std::task;
-
-static mut DROPS: uint = 0;
-
-struct Foo;
-impl Drop for Foo {
-    fn drop(&mut self) {
-        unsafe { DROPS += 1; }
-        panic!()
-    }
-}
-
-fn main() {
-    let _ = task::try(proc() {
-        local_data_key!(foo: Foo);
-        foo.replace(Some(Foo));
-    });
-
-    unsafe {
-        assert_eq!(DROPS, 1);
-    }
-}
-
diff --git a/src/test/run-pass/fail-in-dtor-drops-fields.rs b/src/test/run-pass/fail-in-dtor-drops-fields.rs
deleted file mode 100644 (file)
index 46924c7..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2013 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.
-
-use std::task;
-
-static mut dropped: bool = false;
-
-struct A {
-    b: B,
-}
-
-struct B {
-    foo: int,
-}
-
-impl Drop for A {
-    fn drop(&mut self) {
-        panic!()
-    }
-}
-
-impl Drop for B {
-    fn drop(&mut self) {
-        unsafe { dropped = true; }
-    }
-}
-
-pub fn main() {
-    let ret = task::try(proc() {
-        let _a = A { b: B { foo: 3 } };
-    });
-    assert!(ret.is_err());
-    unsafe { assert!(dropped); }
-}
-
diff --git a/src/test/run-pass/for-loop-fail.rs b/src/test/run-pass/for-loop-fail.rs
deleted file mode 100644 (file)
index d157da3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2012 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.
-
-
-pub fn main() { let x: Vec<int> = Vec::new(); for _ in x.iter() { panic!("moop"); } }
diff --git a/src/test/run-pass/for-loop-panic.rs b/src/test/run-pass/for-loop-panic.rs
new file mode 100644 (file)
index 0000000..d157da3
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2012 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.
+
+
+pub fn main() { let x: Vec<int> = Vec::new(); for _ in x.iter() { panic!("moop"); } }
diff --git a/src/test/run-pass/panic-during-tld-destroy.rs b/src/test/run-pass/panic-during-tld-destroy.rs
new file mode 100644 (file)
index 0000000..2f0d6cf
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2014 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.
+
+use std::task;
+
+static mut DROPS: uint = 0;
+
+struct Foo;
+impl Drop for Foo {
+    fn drop(&mut self) {
+        unsafe { DROPS += 1; }
+        panic!()
+    }
+}
+
+fn main() {
+    let _ = task::try(proc() {
+        local_data_key!(foo: Foo);
+        foo.replace(Some(Foo));
+    });
+
+    unsafe {
+        assert_eq!(DROPS, 1);
+    }
+}
+
diff --git a/src/test/run-pass/panic-in-dtor-drops-fields.rs b/src/test/run-pass/panic-in-dtor-drops-fields.rs
new file mode 100644 (file)
index 0000000..46924c7
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2013 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.
+
+use std::task;
+
+static mut dropped: bool = false;
+
+struct A {
+    b: B,
+}
+
+struct B {
+    foo: int,
+}
+
+impl Drop for A {
+    fn drop(&mut self) {
+        panic!()
+    }
+}
+
+impl Drop for B {
+    fn drop(&mut self) {
+        unsafe { dropped = true; }
+    }
+}
+
+pub fn main() {
+    let ret = task::try(proc() {
+        let _a = A { b: B { foo: 3 } };
+    });
+    assert!(ret.is_err());
+    unsafe { assert!(dropped); }
+}
+
diff --git a/src/test/run-pass/parse-fail.rs b/src/test/run-pass/parse-fail.rs
deleted file mode 100644 (file)
index 0dbba36..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 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(unreachable_code)]
-
-fn dont_call_me() { panic!(); println!("{}", 1i); }
-
-pub fn main() { }
diff --git a/src/test/run-pass/parse-panic.rs b/src/test/run-pass/parse-panic.rs
new file mode 100644 (file)
index 0000000..0dbba36
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2012 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(unreachable_code)]
+
+fn dont_call_me() { panic!(); println!("{}", 1i); }
+
+pub fn main() { }
diff --git a/src/test/run-pass/slice-fail-1.rs b/src/test/run-pass/slice-fail-1.rs
deleted file mode 100644 (file)
index b07cf59..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2014 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.
-
-// Test that is a slicing expr[..] fails, the correct cleanups happen.
-
-#![feature(slicing_syntax)]
-
-use std::task;
-
-struct Foo;
-
-static mut DTOR_COUNT: int = 0;
-
-impl Drop for Foo {
-    fn drop(&mut self) { unsafe { DTOR_COUNT += 1; } }
-}
-
-fn foo() {
-    let x: &[_] = &[Foo, Foo];
-    x[3..4];
-}
-
-fn main() {
-    let _ = task::try(proc() foo());
-    unsafe { assert!(DTOR_COUNT == 2); }
-}
diff --git a/src/test/run-pass/slice-fail-2.rs b/src/test/run-pass/slice-fail-2.rs
deleted file mode 100644 (file)
index 0ac7a20..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2014 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.
-
-// Test that is a slicing expr[..] fails, the correct cleanups happen.
-
-#![feature(slicing_syntax)]
-
-use std::task;
-
-struct Foo;
-
-static mut DTOR_COUNT: int = 0;
-
-impl Drop for Foo {
-    fn drop(&mut self) { unsafe { DTOR_COUNT += 1; } }
-}
-
-fn bar() -> uint {
-    panic!();
-}
-
-fn foo() {
-    let x: &[_] = &[Foo, Foo];
-    x[3..bar()];
-}
-
-fn main() {
-    let _ = task::try(proc() foo());
-    unsafe { assert!(DTOR_COUNT == 2); }
-}
diff --git a/src/test/run-pass/slice-panic-1.rs b/src/test/run-pass/slice-panic-1.rs
new file mode 100644 (file)
index 0000000..b07cf59
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2014 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.
+
+// Test that is a slicing expr[..] fails, the correct cleanups happen.
+
+#![feature(slicing_syntax)]
+
+use std::task;
+
+struct Foo;
+
+static mut DTOR_COUNT: int = 0;
+
+impl Drop for Foo {
+    fn drop(&mut self) { unsafe { DTOR_COUNT += 1; } }
+}
+
+fn foo() {
+    let x: &[_] = &[Foo, Foo];
+    x[3..4];
+}
+
+fn main() {
+    let _ = task::try(proc() foo());
+    unsafe { assert!(DTOR_COUNT == 2); }
+}
diff --git a/src/test/run-pass/slice-panic-2.rs b/src/test/run-pass/slice-panic-2.rs
new file mode 100644 (file)
index 0000000..0ac7a20
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2014 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.
+
+// Test that is a slicing expr[..] fails, the correct cleanups happen.
+
+#![feature(slicing_syntax)]
+
+use std::task;
+
+struct Foo;
+
+static mut DTOR_COUNT: int = 0;
+
+impl Drop for Foo {
+    fn drop(&mut self) { unsafe { DTOR_COUNT += 1; } }
+}
+
+fn bar() -> uint {
+    panic!();
+}
+
+fn foo() {
+    let x: &[_] = &[Foo, Foo];
+    x[3..bar()];
+}
+
+fn main() {
+    let _ = task::try(proc() foo());
+    unsafe { assert!(DTOR_COUNT == 2); }
+}
diff --git a/src/test/run-pass/vector-sort-failure-safe.rs b/src/test/run-pass/vector-sort-failure-safe.rs
deleted file mode 100644 (file)
index ce9cc68..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2013 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.
-
-use std::task;
-use std::sync::atomic::{AtomicUint, INIT_ATOMIC_UINT, Relaxed};
-use std::rand::{task_rng, Rng, Rand};
-
-const REPEATS: uint = 5;
-const MAX_LEN: uint = 32;
-static drop_counts: [AtomicUint, .. MAX_LEN] =
-    // FIXME #5244: AtomicUint is not Copy.
-    [
-        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
-        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
-        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
-        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
-
-        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
-        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
-        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
-        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
-     ];
-
-static creation_count: AtomicUint = INIT_ATOMIC_UINT;
-
-#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord)]
-struct DropCounter { x: uint, creation_id: uint }
-
-impl Rand for DropCounter {
-    fn rand<R: Rng>(rng: &mut R) -> DropCounter {
-        // (we're not using this concurrently, so Relaxed is fine.)
-        let num = creation_count.fetch_add(1, Relaxed);
-        DropCounter {
-            x: rng.gen(),
-            creation_id: num
-        }
-    }
-}
-
-impl Drop for DropCounter {
-    fn drop(&mut self) {
-        drop_counts[self.creation_id].fetch_add(1, Relaxed);
-    }
-}
-
-pub fn main() {
-    assert!(MAX_LEN <= std::uint::BITS);
-    // len can't go above 64.
-    for len in range(2, MAX_LEN) {
-        for _ in range(0, REPEATS) {
-            // reset the count for these new DropCounters, so their
-            // IDs start from 0.
-            creation_count.store(0, Relaxed);
-
-            let main = task_rng().gen_iter::<DropCounter>()
-                                 .take(len)
-                                 .collect::<Vec<DropCounter>>();
-
-            // work out the total number of comparisons required to sort
-            // this array...
-            let mut count = 0;
-            main.clone().as_mut_slice().sort_by(|a, b| { count += 1; a.cmp(b) });
-
-            // ... and then panic on each and every single one.
-            for panic_countdown in range(0i, count) {
-                // refresh the counters.
-                for c in drop_counts.iter() {
-                    c.store(0, Relaxed);
-                }
-
-                let v = main.clone();
-
-                let _ = task::try(proc() {
-                        let mut v = v;
-                        let mut panic_countdown = panic_countdown;
-                        v.as_mut_slice().sort_by(|a, b| {
-                                if panic_countdown == 0 {
-                                    panic!()
-                                }
-                                panic_countdown -= 1;
-                                a.cmp(b)
-                            })
-                    });
-
-                // check that the number of things dropped is exactly
-                // what we expect (i.e. the contents of `v`).
-                for (i, c) in drop_counts.iter().enumerate().take(len) {
-                    let count = c.load(Relaxed);
-                    assert!(count == 1,
-                            "found drop count == {} for i == {}, len == {}",
-                            count, i, len);
-                }
-            }
-        }
-    }
-}
diff --git a/src/test/run-pass/vector-sort-panic-safe.rs b/src/test/run-pass/vector-sort-panic-safe.rs
new file mode 100644 (file)
index 0000000..ce9cc68
--- /dev/null
@@ -0,0 +1,103 @@
+// Copyright 2013 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.
+
+use std::task;
+use std::sync::atomic::{AtomicUint, INIT_ATOMIC_UINT, Relaxed};
+use std::rand::{task_rng, Rng, Rand};
+
+const REPEATS: uint = 5;
+const MAX_LEN: uint = 32;
+static drop_counts: [AtomicUint, .. MAX_LEN] =
+    // FIXME #5244: AtomicUint is not Copy.
+    [
+        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
+        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
+        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
+        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
+
+        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
+        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
+        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
+        INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT, INIT_ATOMIC_UINT,
+     ];
+
+static creation_count: AtomicUint = INIT_ATOMIC_UINT;
+
+#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord)]
+struct DropCounter { x: uint, creation_id: uint }
+
+impl Rand for DropCounter {
+    fn rand<R: Rng>(rng: &mut R) -> DropCounter {
+        // (we're not using this concurrently, so Relaxed is fine.)
+        let num = creation_count.fetch_add(1, Relaxed);
+        DropCounter {
+            x: rng.gen(),
+            creation_id: num
+        }
+    }
+}
+
+impl Drop for DropCounter {
+    fn drop(&mut self) {
+        drop_counts[self.creation_id].fetch_add(1, Relaxed);
+    }
+}
+
+pub fn main() {
+    assert!(MAX_LEN <= std::uint::BITS);
+    // len can't go above 64.
+    for len in range(2, MAX_LEN) {
+        for _ in range(0, REPEATS) {
+            // reset the count for these new DropCounters, so their
+            // IDs start from 0.
+            creation_count.store(0, Relaxed);
+
+            let main = task_rng().gen_iter::<DropCounter>()
+                                 .take(len)
+                                 .collect::<Vec<DropCounter>>();
+
+            // work out the total number of comparisons required to sort
+            // this array...
+            let mut count = 0;
+            main.clone().as_mut_slice().sort_by(|a, b| { count += 1; a.cmp(b) });
+
+            // ... and then panic on each and every single one.
+            for panic_countdown in range(0i, count) {
+                // refresh the counters.
+                for c in drop_counts.iter() {
+                    c.store(0, Relaxed);
+                }
+
+                let v = main.clone();
+
+                let _ = task::try(proc() {
+                        let mut v = v;
+                        let mut panic_countdown = panic_countdown;
+                        v.as_mut_slice().sort_by(|a, b| {
+                                if panic_countdown == 0 {
+                                    panic!()
+                                }
+                                panic_countdown -= 1;
+                                a.cmp(b)
+                            })
+                    });
+
+                // check that the number of things dropped is exactly
+                // what we expect (i.e. the contents of `v`).
+                for (i, c) in drop_counts.iter().enumerate().take(len) {
+                    let count = c.load(Relaxed);
+                    assert!(count == 1,
+                            "found drop count == {} for i == {}, len == {}",
+                            count, i, len);
+                }
+            }
+        }
+    }
+}