about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-04-16 15:50:32 +0900
committerYuki Okushi <huyuumi.dev@gmail.com>2020-05-06 14:02:55 +0900
commite69748ba4f48efdc9a1dfcf8c16bc9aba39a86e3 (patch)
tree33fc77d7a08037da5deeb878068f5af0284aa732 /src/test/ui
parent43271a39adc26d29350d4830b594c6435472815e (diff)
Move tests from `test/run-fail` to UI
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/array-slice-vec/bounds-check-no-overflow.rs10
-rw-r--r--src/test/ui/array-slice-vec/dst-raw-slice.rs11
-rw-r--r--src/test/ui/binop/binop-fail-3.rs10
-rw-r--r--src/test/ui/binop/binop-panic.rs11
-rw-r--r--src/test/ui/borrowck/borrowck-local-borrow.rs11
-rw-r--r--src/test/ui/closures/diverging-closure.rs9
-rw-r--r--src/test/ui/consts/promoted_div_by_zero.rs8
-rw-r--r--src/test/ui/fn/expr-fn-panic.rs10
-rw-r--r--src/test/ui/generator/generator-resume-after-panic.rs23
-rw-r--r--src/test/ui/hashmap/hashmap-capacity-overflow.rs12
-rw-r--r--src/test/ui/hashmap/hashmap-iter-value-lifetime.nll.stderr (renamed from src/test/ui/hashmap-iter-value-lifetime.nll.stderr)0
-rw-r--r--src/test/ui/hashmap/hashmap-iter-value-lifetime.rs (renamed from src/test/ui/hashmap-iter-value-lifetime.rs)0
-rw-r--r--src/test/ui/hashmap/hashmap-iter-value-lifetime.stderr (renamed from src/test/ui/hashmap-iter-value-lifetime.stderr)0
-rw-r--r--src/test/ui/hashmap/hashmap-lifetimes.nll.stderr (renamed from src/test/ui/hashmap-lifetimes.nll.stderr)0
-rw-r--r--src/test/ui/hashmap/hashmap-lifetimes.rs (renamed from src/test/ui/hashmap-lifetimes.rs)0
-rw-r--r--src/test/ui/hashmap/hashmap-lifetimes.stderr (renamed from src/test/ui/hashmap-lifetimes.stderr)0
-rw-r--r--src/test/ui/hashmap/hashmap-memory.rs (renamed from src/test/ui/hashmap-memory.rs)0
-rw-r--r--src/test/ui/if/expr-if-panic-fn.rs19
-rw-r--r--src/test/ui/if/expr-if-panic.rs12
-rw-r--r--src/test/ui/if/if-check-panic.rs24
-rw-r--r--src/test/ui/if/if-cond-bot.rs12
-rw-r--r--src/test/ui/imports/glob-use-std.rs10
-rw-r--r--src/test/ui/issues/issue-12920.rs7
-rw-r--r--src/test/ui/issues/issue-13202.rs6
-rw-r--r--src/test/ui/issues/issue-18576.rs15
-rw-r--r--src/test/ui/issues/issue-20971.rs22
-rw-r--r--src/test/ui/issues/issue-23354-2.rs8
-rw-r--r--src/test/ui/issues/issue-23354.rs7
-rw-r--r--src/test/ui/issues/issue-2444.rs16
-rw-r--r--src/test/ui/issues/issue-2470-bounds-check-overflow.rs26
-rw-r--r--src/test/ui/issues/issue-2761.rs6
-rw-r--r--src/test/ui/issues/issue-28934.rs24
-rw-r--r--src/test/ui/issues/issue-29798.rs10
-rw-r--r--src/test/ui/issues/issue-3029.rs13
-rw-r--r--src/test/ui/issues/issue-30380.rs35
-rw-r--r--src/test/ui/issues/issue-44216-add-instant.rs9
-rw-r--r--src/test/ui/issues/issue-44216-add-system-time.rs9
-rw-r--r--src/test/ui/issues/issue-44216-sub-instant.rs9
-rw-r--r--src/test/ui/issues/issue-44216-sub-system-time.rs9
-rw-r--r--src/test/ui/issues/issue-51345-2.rs7
-rw-r--r--src/test/ui/issues/issue-6458-1.rs7
-rw-r--r--src/test/ui/issues/issue-811.rs25
-rw-r--r--src/test/ui/issues/issue-948.rs14
-rw-r--r--src/test/ui/loops/for-each-loop-panic.rs8
-rw-r--r--src/test/ui/macros/assert-as-macro.rs6
-rw-r--r--src/test/ui/macros/assert-eq-macro-panic.rs8
-rw-r--r--src/test/ui/macros/assert-macro-explicit.rs6
-rw-r--r--src/test/ui/macros/assert-macro-fmt.rs6
-rw-r--r--src/test/ui/macros/assert-macro-owned.rs6
-rw-r--r--src/test/ui/macros/assert-macro-static.rs6
-rw-r--r--src/test/ui/macros/assert-ne-macro-panic.rs8
-rw-r--r--src/test/ui/macros/die-macro-2.rs6
-rw-r--r--src/test/ui/macros/die-macro-expr.rs6
-rw-r--r--src/test/ui/macros/die-macro-pure.rs10
-rw-r--r--src/test/ui/macros/unimplemented-macro-panic.rs6
-rw-r--r--src/test/ui/macros/unreachable-fmt-msg.rs6
-rw-r--r--src/test/ui/macros/unreachable-macro-panic.rs6
-rw-r--r--src/test/ui/macros/unreachable-static-msg.rs6
-rw-r--r--src/test/ui/macros/unreachable.rs6
-rw-r--r--src/test/ui/match/expr-match-panic-fn.rs18
-rw-r--r--src/test/ui/match/expr-match-panic.rs9
-rw-r--r--src/test/ui/match/match-bot-panic.rs15
-rw-r--r--src/test/ui/match/match-disc-bot.rs15
-rw-r--r--src/test/ui/match/match-wildcards.rs20
-rw-r--r--src/test/ui/meta-revision-bad.rs21
-rw-r--r--src/test/ui/meta-revision-ok.rs20
-rw-r--r--src/test/ui/mir/mir_codegen_calls_converging_drops.rs25
-rw-r--r--src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs29
-rw-r--r--src/test/ui/mir/mir_codegen_calls_diverging.rs14
-rw-r--r--src/test/ui/mir/mir_codegen_calls_diverging_drops.rs23
-rw-r--r--src/test/ui/mir/mir_drop_panics.rs23
-rw-r--r--src/test/ui/mir/mir_dynamic_drops_1.rs31
-rw-r--r--src/test/ui/mir/mir_dynamic_drops_2.rs29
-rw-r--r--src/test/ui/mir/mir_dynamic_drops_3.rs34
-rw-r--r--src/test/ui/mir/mir_indexing_oob_1.rs13
-rw-r--r--src/test/ui/mir/mir_indexing_oob_2.rs13
-rw-r--r--src/test/ui/mir/mir_indexing_oob_3.rs13
-rw-r--r--src/test/ui/never_type/return-never-coerce.rs17
-rw-r--r--src/test/ui/numbers-arithmetic/divide-by-zero.rs7
-rw-r--r--src/test/ui/numbers-arithmetic/mod-zero.rs7
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-add.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs24
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-mul.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-neg.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs7
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs7
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs24
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr14
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-sub.rs9
-rw-r--r--src/test/ui/numbers-arithmetic/promoted_overflow.rs9
-rw-r--r--src/test/ui/panic-runtime/unwind-interleaved.rs15
-rw-r--r--src/test/ui/panic-runtime/unwind-rec.rs14
-rw-r--r--src/test/ui/panic-runtime/unwind-rec2.rs22
-rw-r--r--src/test/ui/panic-runtime/unwind-unique.rs11
-rw-r--r--src/test/ui/panics/args-panic.rs12
-rw-r--r--src/test/ui/panics/doublepanic.rs9
-rw-r--r--src/test/ui/panics/explicit-panic-msg.rs13
-rw-r--r--src/test/ui/panics/explicit-panic.rs6
-rw-r--r--src/test/ui/panics/fmt-panic.rs7
-rw-r--r--src/test/ui/panics/main-panic.rs6
-rw-r--r--src/test/ui/panics/panic-arg.rs10
-rw-r--r--src/test/ui/panics/panic-macro-any-wrapped.rs6
-rw-r--r--src/test/ui/panics/panic-macro-any.rs8
-rw-r--r--src/test/ui/panics/panic-macro-explicit.rs6
-rw-r--r--src/test/ui/panics/panic-macro-fmt.rs6
-rw-r--r--src/test/ui/panics/panic-macro-owned.rs6
-rw-r--r--src/test/ui/panics/panic-macro-static.rs6
-rw-r--r--src/test/ui/panics/panic-main.rs6
-rw-r--r--src/test/ui/panics/panic-parens.rs18
-rw-r--r--src/test/ui/panics/panic-set-handler.rs11
-rw-r--r--src/test/ui/panics/panic-set-unset-handler.rs12
-rw-r--r--src/test/ui/panics/panic-take-handler-nop.rs9
-rw-r--r--src/test/ui/panics/panic-task-name-none.rs13
-rw-r--r--src/test/ui/panics/panic-task-name-owned.rs18
-rw-r--r--src/test/ui/panics/panic.rs6
-rw-r--r--src/test/ui/panics/result-get-panic.rs8
-rw-r--r--src/test/ui/panics/test-panic.rs9
-rw-r--r--src/test/ui/panics/test-should-fail-bad-message.rs10
-rw-r--r--src/test/ui/panics/test-should-panic-bad-message.rs9
-rw-r--r--src/test/ui/panics/test-should-panic-no-message.rs9
-rw-r--r--src/test/ui/panics/unique-panic.rs6
-rw-r--r--src/test/ui/panics/while-body-panics.rs13
-rw-r--r--src/test/ui/panics/while-panic.rs13
-rw-r--r--src/test/ui/process/tls-exit-status.rs11
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs10
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs6
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs9
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs7
-rw-r--r--src/test/ui/str/str-overrun.rs9
-rw-r--r--src/test/ui/structs/rhs-type.rs17
-rw-r--r--src/test/ui/test-attrs/run-unexported-tests.rs12
-rw-r--r--src/test/ui/threads-sendsync/task-spawn-barefn.rs18
-rw-r--r--src/test/ui/threads-sendsync/test-tasks-invalid-value.rs11
-rw-r--r--src/test/ui/vec/vec-overrun.rs11
151 files changed, 1751 insertions, 0 deletions
diff --git a/src/test/ui/array-slice-vec/bounds-check-no-overflow.rs b/src/test/ui/array-slice-vec/bounds-check-no-overflow.rs
new file mode 100644
index 00000000000..70cbb067254
--- /dev/null
+++ b/src/test/ui/array-slice-vec/bounds-check-no-overflow.rs
@@ -0,0 +1,10 @@
+// run-fail
+// error-pattern:index out of bounds
+
+use std::usize;
+use std::mem::size_of;
+
+fn main() {
+    let xs = [1, 2, 3];
+    xs[usize::MAX / size_of::<isize>() + 1];
+}
diff --git a/src/test/ui/array-slice-vec/dst-raw-slice.rs b/src/test/ui/array-slice-vec/dst-raw-slice.rs
new file mode 100644
index 00000000000..33db126944d
--- /dev/null
+++ b/src/test/ui/array-slice-vec/dst-raw-slice.rs
@@ -0,0 +1,11 @@
+// Test bounds checking for DST raw slices
+
+// run-fail
+// error-pattern:index out of bounds
+#[allow(unconditional_panic)]
+fn main() {
+    let a: *const [_] = &[1, 2, 3];
+    unsafe {
+        let _b = (*a)[3];
+    }
+}
diff --git a/src/test/ui/binop/binop-fail-3.rs b/src/test/ui/binop/binop-fail-3.rs
new file mode 100644
index 00000000000..7120a5c1f19
--- /dev/null
+++ b/src/test/ui/binop/binop-fail-3.rs
@@ -0,0 +1,10 @@
+// run-fail
+// error-pattern:quux
+
+fn foo() -> ! {
+    panic!("quux");
+}
+
+fn main() {
+    foo() == foo(); // these types wind up being defaulted to ()
+}
diff --git a/src/test/ui/binop/binop-panic.rs b/src/test/ui/binop/binop-panic.rs
new file mode 100644
index 00000000000..6927b96c1b3
--- /dev/null
+++ b/src/test/ui/binop/binop-panic.rs
@@ -0,0 +1,11 @@
+// run-fail
+// error-pattern:quux
+
+fn my_err(s: String) -> ! {
+    println!("{}", s);
+    panic!("quux");
+}
+
+fn main() {
+    3_usize == my_err("bye".to_string());
+}
diff --git a/src/test/ui/borrowck/borrowck-local-borrow.rs b/src/test/ui/borrowck/borrowck-local-borrow.rs
new file mode 100644
index 00000000000..c2b59ecce86
--- /dev/null
+++ b/src/test/ui/borrowck/borrowck-local-borrow.rs
@@ -0,0 +1,11 @@
+// run-fail
+// error-pattern:panic 1
+
+// revisions: migrate mir
+//[mir]compile-flags: -Z borrowck=mir
+
+fn main() {
+    let x = 2;
+    let y = &x;
+    panic!("panic 1");
+}
diff --git a/src/test/ui/closures/diverging-closure.rs b/src/test/ui/closures/diverging-closure.rs
new file mode 100644
index 00000000000..de7b68ef684
--- /dev/null
+++ b/src/test/ui/closures/diverging-closure.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:oops
+
+fn main() {
+    let func = || -> ! {
+        panic!("oops");
+    };
+    func();
+}
diff --git a/src/test/ui/consts/promoted_div_by_zero.rs b/src/test/ui/consts/promoted_div_by_zero.rs
new file mode 100644
index 00000000000..582c186b4e4
--- /dev/null
+++ b/src/test/ui/consts/promoted_div_by_zero.rs
@@ -0,0 +1,8 @@
+#![allow(unconditional_panic, const_err)]
+
+// run-fail
+// error-pattern: attempt to divide by zero
+
+fn main() {
+    let x = &(1 / (1 - 1));
+}
diff --git a/src/test/ui/fn/expr-fn-panic.rs b/src/test/ui/fn/expr-fn-panic.rs
new file mode 100644
index 00000000000..e93439a1d17
--- /dev/null
+++ b/src/test/ui/fn/expr-fn-panic.rs
@@ -0,0 +1,10 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn f() -> ! {
+    panic!()
+}
+
+fn main() {
+    f();
+}
diff --git a/src/test/ui/generator/generator-resume-after-panic.rs b/src/test/ui/generator/generator-resume-after-panic.rs
new file mode 100644
index 00000000000..1e9a7ed1e94
--- /dev/null
+++ b/src/test/ui/generator/generator-resume-after-panic.rs
@@ -0,0 +1,23 @@
+// run-fail
+// error-pattern:generator resumed after panicking
+
+// Test that we get the correct message for resuming a panicked generator.
+
+#![feature(generators, generator_trait)]
+
+use std::{
+    ops::Generator,
+    pin::Pin,
+    panic,
+};
+
+fn main() {
+    let mut g = || {
+        panic!();
+        yield;
+    };
+    panic::catch_unwind(panic::AssertUnwindSafe(|| {
+        let x = Pin::new(&mut g).resume(());
+    }));
+    Pin::new(&mut g).resume(());
+}
diff --git a/src/test/ui/hashmap/hashmap-capacity-overflow.rs b/src/test/ui/hashmap/hashmap-capacity-overflow.rs
new file mode 100644
index 00000000000..0e904b7b6a4
--- /dev/null
+++ b/src/test/ui/hashmap/hashmap-capacity-overflow.rs
@@ -0,0 +1,12 @@
+// run-fail
+// error-pattern:capacity overflow
+
+use std::collections::hash_map::HashMap;
+use std::usize;
+use std::mem::size_of;
+
+fn main() {
+    let threshold = usize::MAX / size_of::<(u64, u64, u64)>();
+    let mut h = HashMap::<u64, u64>::with_capacity(threshold + 100);
+    h.insert(0, 0);
+}
diff --git a/src/test/ui/hashmap-iter-value-lifetime.nll.stderr b/src/test/ui/hashmap/hashmap-iter-value-lifetime.nll.stderr
index 312a91adca6..312a91adca6 100644
--- a/src/test/ui/hashmap-iter-value-lifetime.nll.stderr
+++ b/src/test/ui/hashmap/hashmap-iter-value-lifetime.nll.stderr
diff --git a/src/test/ui/hashmap-iter-value-lifetime.rs b/src/test/ui/hashmap/hashmap-iter-value-lifetime.rs
index 260ea8c7ae1..260ea8c7ae1 100644
--- a/src/test/ui/hashmap-iter-value-lifetime.rs
+++ b/src/test/ui/hashmap/hashmap-iter-value-lifetime.rs
diff --git a/src/test/ui/hashmap-iter-value-lifetime.stderr b/src/test/ui/hashmap/hashmap-iter-value-lifetime.stderr
index f7626b13bad..f7626b13bad 100644
--- a/src/test/ui/hashmap-iter-value-lifetime.stderr
+++ b/src/test/ui/hashmap/hashmap-iter-value-lifetime.stderr
diff --git a/src/test/ui/hashmap-lifetimes.nll.stderr b/src/test/ui/hashmap/hashmap-lifetimes.nll.stderr
index aa8e890c168..aa8e890c168 100644
--- a/src/test/ui/hashmap-lifetimes.nll.stderr
+++ b/src/test/ui/hashmap/hashmap-lifetimes.nll.stderr
diff --git a/src/test/ui/hashmap-lifetimes.rs b/src/test/ui/hashmap/hashmap-lifetimes.rs
index 295bf3b0e66..295bf3b0e66 100644
--- a/src/test/ui/hashmap-lifetimes.rs
+++ b/src/test/ui/hashmap/hashmap-lifetimes.rs
diff --git a/src/test/ui/hashmap-lifetimes.stderr b/src/test/ui/hashmap/hashmap-lifetimes.stderr
index 497c7d1216c..497c7d1216c 100644
--- a/src/test/ui/hashmap-lifetimes.stderr
+++ b/src/test/ui/hashmap/hashmap-lifetimes.stderr
diff --git a/src/test/ui/hashmap-memory.rs b/src/test/ui/hashmap/hashmap-memory.rs
index 3129eb0da82..3129eb0da82 100644
--- a/src/test/ui/hashmap-memory.rs
+++ b/src/test/ui/hashmap/hashmap-memory.rs
diff --git a/src/test/ui/if/expr-if-panic-fn.rs b/src/test/ui/if/expr-if-panic-fn.rs
new file mode 100644
index 00000000000..7ddd4bc5e0f
--- /dev/null
+++ b/src/test/ui/if/expr-if-panic-fn.rs
@@ -0,0 +1,19 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn f() -> ! {
+    panic!()
+}
+
+fn g() -> isize {
+    let x = if true {
+        f()
+    } else {
+        10
+    };
+    return x;
+}
+
+fn main() {
+    g();
+}
diff --git a/src/test/ui/if/expr-if-panic.rs b/src/test/ui/if/expr-if-panic.rs
new file mode 100644
index 00000000000..4ab73dc736a
--- /dev/null
+++ b/src/test/ui/if/expr-if-panic.rs
@@ -0,0 +1,12 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn main() {
+    let _x = if false {
+        0
+    } else if true {
+        panic!()
+    } else {
+        10
+    };
+}
diff --git a/src/test/ui/if/if-check-panic.rs b/src/test/ui/if/if-check-panic.rs
new file mode 100644
index 00000000000..d768cf10c8b
--- /dev/null
+++ b/src/test/ui/if/if-check-panic.rs
@@ -0,0 +1,24 @@
+// run-fail
+// error-pattern:Number is odd
+
+fn even(x: usize) -> bool {
+    if x < 2 {
+        return false;
+    } else if x == 2 {
+        return true;
+    } else {
+        return even(x - 2);
+    }
+}
+
+fn foo(x: usize) {
+    if even(x) {
+        println!("{}", x);
+    } else {
+        panic!("Number is odd");
+    }
+}
+
+fn main() {
+    foo(3);
+}
diff --git a/src/test/ui/if/if-cond-bot.rs b/src/test/ui/if/if-cond-bot.rs
new file mode 100644
index 00000000000..3bbea458446
--- /dev/null
+++ b/src/test/ui/if/if-cond-bot.rs
@@ -0,0 +1,12 @@
+// run-fail
+// error-pattern:quux
+
+fn my_err(s: String) -> ! {
+    println!("{}", s);
+    panic!("quux");
+}
+
+fn main() {
+    if my_err("bye".to_string()) {
+    }
+}
diff --git a/src/test/ui/imports/glob-use-std.rs b/src/test/ui/imports/glob-use-std.rs
new file mode 100644
index 00000000000..3cd6a380ed2
--- /dev/null
+++ b/src/test/ui/imports/glob-use-std.rs
@@ -0,0 +1,10 @@
+// Issue #7580
+
+// run-fail
+// error-pattern:panic works
+
+use std::*;
+
+fn main() {
+    panic!("panic works")
+}
diff --git a/src/test/ui/issues/issue-12920.rs b/src/test/ui/issues/issue-12920.rs
new file mode 100644
index 00000000000..85d199f6d82
--- /dev/null
+++ b/src/test/ui/issues/issue-12920.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:explicit panic
+
+pub fn main() {
+    panic!();
+    println!("{}", 1);
+}
diff --git a/src/test/ui/issues/issue-13202.rs b/src/test/ui/issues/issue-13202.rs
new file mode 100644
index 00000000000..511273bae9d
--- /dev/null
+++ b/src/test/ui/issues/issue-13202.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:bad input
+
+fn main() {
+    Some("foo").unwrap_or(panic!("bad input")).to_string();
+}
diff --git a/src/test/ui/issues/issue-18576.rs b/src/test/ui/issues/issue-18576.rs
new file mode 100644
index 00000000000..946d2d47369
--- /dev/null
+++ b/src/test/ui/issues/issue-18576.rs
@@ -0,0 +1,15 @@
+// run-fail
+// error-pattern:stop
+
+// #18576
+// Make sure that calling an extern function pointer in an unreachable
+// context doesn't cause an LLVM assertion
+
+#[allow(unreachable_code)]
+fn main() {
+    panic!("stop");
+    let pointer = other;
+    pointer();
+}
+
+extern "C" fn other() {}
diff --git a/src/test/ui/issues/issue-20971.rs b/src/test/ui/issues/issue-20971.rs
new file mode 100644
index 00000000000..4fb901e2272
--- /dev/null
+++ b/src/test/ui/issues/issue-20971.rs
@@ -0,0 +1,22 @@
+// Regression test for Issue #20971.
+
+// run-fail
+// error-pattern:Hello, world!
+
+pub trait Parser {
+    type Input;
+    fn parse(&mut self, input: <Self as Parser>::Input);
+}
+
+impl Parser for () {
+    type Input = ();
+    fn parse(&mut self, input: ()) {}
+}
+
+pub fn many() -> Box<dyn Parser<Input = <() as Parser>::Input> + 'static> {
+    panic!("Hello, world!")
+}
+
+fn main() {
+    many().parse(());
+}
diff --git a/src/test/ui/issues/issue-23354-2.rs b/src/test/ui/issues/issue-23354-2.rs
new file mode 100644
index 00000000000..1a3ed103060
--- /dev/null
+++ b/src/test/ui/issues/issue-23354-2.rs
@@ -0,0 +1,8 @@
+// run-fail
+// error-pattern:panic evaluated
+
+#[allow(unused_variables)]
+fn main() {
+    // This used to trigger an LLVM assertion during compilation
+    let x = [panic!("panic evaluated"); 2];
+}
diff --git a/src/test/ui/issues/issue-23354.rs b/src/test/ui/issues/issue-23354.rs
new file mode 100644
index 00000000000..77b7dbf99da
--- /dev/null
+++ b/src/test/ui/issues/issue-23354.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:panic evaluated
+
+#[allow(unused_variables)]
+fn main() {
+    let x = [panic!("panic evaluated"); 0];
+}
diff --git a/src/test/ui/issues/issue-2444.rs b/src/test/ui/issues/issue-2444.rs
new file mode 100644
index 00000000000..35d8eabcd60
--- /dev/null
+++ b/src/test/ui/issues/issue-2444.rs
@@ -0,0 +1,16 @@
+// run-fail
+// error-pattern:explicit panic
+
+use std::sync::Arc;
+
+enum Err<T> {
+    Errr(Arc<T>),
+}
+
+fn foo() -> Err<isize> {
+    panic!();
+}
+
+fn main() {
+    let _f = foo();
+}
diff --git a/src/test/ui/issues/issue-2470-bounds-check-overflow.rs b/src/test/ui/issues/issue-2470-bounds-check-overflow.rs
new file mode 100644
index 00000000000..86558c228c5
--- /dev/null
+++ b/src/test/ui/issues/issue-2470-bounds-check-overflow.rs
@@ -0,0 +1,26 @@
+// run-fail
+// error-pattern:index out of bounds
+
+use std::mem;
+
+fn main() {
+
+    // This should cause a bounds-check panic, but may not if we do our
+    // bounds checking by comparing the scaled index to the vector's
+    // address-bounds, since we've scaled the index to wrap around to the
+    // address of the 0th cell in the array (even though the index is
+    // huge).
+
+    let x = vec![1_usize, 2_usize, 3_usize];
+
+    let base = x.as_ptr() as usize;
+    let idx = base / mem::size_of::<usize>();
+    println!("ov1 base = 0x{:x}", base);
+    println!("ov1 idx = 0x{:x}", idx);
+    println!("ov1 sizeof::<usize>() = 0x{:x}", mem::size_of::<usize>());
+    println!("ov1 idx * sizeof::<usize>() = 0x{:x}",
+             idx * mem::size_of::<usize>());
+
+    // This should panic.
+    println!("ov1 0x{:x}", x[idx]);
+}
diff --git a/src/test/ui/issues/issue-2761.rs b/src/test/ui/issues/issue-2761.rs
new file mode 100644
index 00000000000..43756645925
--- /dev/null
+++ b/src/test/ui/issues/issue-2761.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:custom message
+
+fn main() {
+    assert!(false, "custom message");
+}
diff --git a/src/test/ui/issues/issue-28934.rs b/src/test/ui/issues/issue-28934.rs
new file mode 100644
index 00000000000..fcf91d74fbe
--- /dev/null
+++ b/src/test/ui/issues/issue-28934.rs
@@ -0,0 +1,24 @@
+// Regression test: issue had to do with "givens" in region inference,
+// which were not being considered during the contraction phase.
+
+// run-fail
+// error-pattern:explicit panic
+
+struct Parser<'i: 't, 't>(&'i u8, &'t u8);
+
+impl<'i, 't> Parser<'i, 't> {
+    fn parse_nested_block<F, T>(&mut self, parse: F) -> Result<T, ()>
+        where for<'tt> F: FnOnce(&mut Parser<'i, 'tt>) -> T
+    {
+        panic!()
+    }
+
+    fn expect_exhausted(&mut self) -> Result<(), ()> {
+        Ok(())
+    }
+}
+
+fn main() {
+    let x = 0u8;
+    Parser(&x, &x).parse_nested_block(|input| input.expect_exhausted()).unwrap();
+}
diff --git a/src/test/ui/issues/issue-29798.rs b/src/test/ui/issues/issue-29798.rs
new file mode 100644
index 00000000000..31b08f2164a
--- /dev/null
+++ b/src/test/ui/issues/issue-29798.rs
@@ -0,0 +1,10 @@
+// run-fail
+// error-pattern:index out of bounds: the len is 5 but the index is 5
+
+const fn test(x: usize) -> i32 {
+    [42;5][x]
+}
+
+fn main () {
+    let _ = test(5);
+}
diff --git a/src/test/ui/issues/issue-3029.rs b/src/test/ui/issues/issue-3029.rs
new file mode 100644
index 00000000000..aea2368a211
--- /dev/null
+++ b/src/test/ui/issues/issue-3029.rs
@@ -0,0 +1,13 @@
+// run-fail
+// error-pattern:so long
+
+#![allow(unused_allocation)]
+#![allow(unreachable_code)]
+#![allow(unused_variables)]
+
+fn main() {
+    let mut x = Vec::new();
+    let y = vec![3];
+    panic!("so long");
+    x.extend(y.into_iter());
+}
diff --git a/src/test/ui/issues/issue-30380.rs b/src/test/ui/issues/issue-30380.rs
new file mode 100644
index 00000000000..34bd6c1b0e5
--- /dev/null
+++ b/src/test/ui/issues/issue-30380.rs
@@ -0,0 +1,35 @@
+// check that panics in destructors during assignment do not leave
+// destroyed values lying around for other destructors to observe.
+
+// run-fail
+// error-pattern:panicking destructors ftw!
+
+struct Observer<'a>(&'a mut FilledOnDrop);
+
+struct FilledOnDrop(u32);
+impl Drop for FilledOnDrop {
+    fn drop(&mut self) {
+        if self.0 == 0 {
+            // this is only set during the destructor - safe
+            // code should not be able to observe this.
+            self.0 = 0x1c1c1c1c;
+            panic!("panicking destructors ftw!");
+        }
+    }
+}
+
+impl<'a> Drop for Observer<'a> {
+    fn drop(&mut self) {
+        assert_eq!(self.0 .0, 1);
+    }
+}
+
+fn foo(b: &mut Observer) {
+    *b.0 = FilledOnDrop(1);
+}
+
+fn main() {
+    let mut bomb = FilledOnDrop(0);
+    let mut observer = Observer(&mut bomb);
+    foo(&mut observer);
+}
diff --git a/src/test/ui/issues/issue-44216-add-instant.rs b/src/test/ui/issues/issue-44216-add-instant.rs
new file mode 100644
index 00000000000..b5f48e8cedc
--- /dev/null
+++ b/src/test/ui/issues/issue-44216-add-instant.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:overflow
+
+use std::time::{Instant, Duration};
+
+fn main() {
+    let now = Instant::now();
+    let _ = now + Duration::from_secs(u64::max_value());
+}
diff --git a/src/test/ui/issues/issue-44216-add-system-time.rs b/src/test/ui/issues/issue-44216-add-system-time.rs
new file mode 100644
index 00000000000..da28433dde9
--- /dev/null
+++ b/src/test/ui/issues/issue-44216-add-system-time.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:overflow
+
+use std::time::{Duration, SystemTime};
+
+fn main() {
+    let now = SystemTime::now();
+    let _ = now + Duration::from_secs(u64::max_value());
+}
diff --git a/src/test/ui/issues/issue-44216-sub-instant.rs b/src/test/ui/issues/issue-44216-sub-instant.rs
new file mode 100644
index 00000000000..954cf45591f
--- /dev/null
+++ b/src/test/ui/issues/issue-44216-sub-instant.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:overflow
+
+use std::time::{Instant, Duration};
+
+fn main() {
+    let now = Instant::now();
+    let _ = now - Duration::from_secs(u64::max_value());
+}
diff --git a/src/test/ui/issues/issue-44216-sub-system-time.rs b/src/test/ui/issues/issue-44216-sub-system-time.rs
new file mode 100644
index 00000000000..e024e231565
--- /dev/null
+++ b/src/test/ui/issues/issue-44216-sub-system-time.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:overflow
+
+use std::time::{Duration, SystemTime};
+
+fn main() {
+    let now = SystemTime::now();
+    let _ = now - Duration::from_secs(u64::max_value());
+}
diff --git a/src/test/ui/issues/issue-51345-2.rs b/src/test/ui/issues/issue-51345-2.rs
new file mode 100644
index 00000000000..4abdba6176a
--- /dev/null
+++ b/src/test/ui/issues/issue-51345-2.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern: thread 'main' panicked at 'explicit panic'
+
+fn main() {
+    let mut vec = vec![];
+    vec.push((vec.len(), panic!()));
+}
diff --git a/src/test/ui/issues/issue-6458-1.rs b/src/test/ui/issues/issue-6458-1.rs
new file mode 100644
index 00000000000..16c479a6a5c
--- /dev/null
+++ b/src/test/ui/issues/issue-6458-1.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn foo<T>(t: T) {}
+fn main() {
+    foo(panic!())
+}
diff --git a/src/test/ui/issues/issue-811.rs b/src/test/ui/issues/issue-811.rs
new file mode 100644
index 00000000000..d16467e4b51
--- /dev/null
+++ b/src/test/ui/issues/issue-811.rs
@@ -0,0 +1,25 @@
+// run-fail
+// error-pattern:quux
+
+use std::marker::PhantomData;
+
+fn test00_start(ch: Chan<isize>, message: isize) {
+    send(ch, message);
+}
+
+type TaskId = isize;
+type PortId = isize;
+
+struct Chan<T> {
+    task: TaskId,
+    port: PortId,
+    marker: PhantomData<*mut T>,
+}
+
+fn send<T: Send>(_ch: Chan<T>, _data: T) {
+    panic!();
+}
+
+fn main() {
+    panic!("quux");
+}
diff --git a/src/test/ui/issues/issue-948.rs b/src/test/ui/issues/issue-948.rs
new file mode 100644
index 00000000000..ab0cee71929
--- /dev/null
+++ b/src/test/ui/issues/issue-948.rs
@@ -0,0 +1,14 @@
+// run-fail
+// error-pattern:beep boop
+
+#![allow(unused_variables)]
+
+struct Point {
+    x: isize,
+    y: isize,
+}
+
+fn main() {
+    let origin = Point { x: 0, y: 0 };
+    let f: Point = Point { x: (panic!("beep boop")), ..origin };
+}
diff --git a/src/test/ui/loops/for-each-loop-panic.rs b/src/test/ui/loops/for-each-loop-panic.rs
new file mode 100644
index 00000000000..1d0dbe176ae
--- /dev/null
+++ b/src/test/ui/loops/for-each-loop-panic.rs
@@ -0,0 +1,8 @@
+// run-fail
+// error-pattern:moop
+
+fn main() {
+    for _ in 0_usize..10_usize {
+        panic!("moop");
+    }
+}
diff --git a/src/test/ui/macros/assert-as-macro.rs b/src/test/ui/macros/assert-as-macro.rs
new file mode 100644
index 00000000000..bc51b673606
--- /dev/null
+++ b/src/test/ui/macros/assert-as-macro.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:assertion failed: 1 == 2
+
+fn main() {
+    assert!(1 == 2);
+}
diff --git a/src/test/ui/macros/assert-eq-macro-panic.rs b/src/test/ui/macros/assert-eq-macro-panic.rs
new file mode 100644
index 00000000000..bd4eb78de9f
--- /dev/null
+++ b/src/test/ui/macros/assert-eq-macro-panic.rs
@@ -0,0 +1,8 @@
+// run-fail
+// error-pattern:assertion failed: `(left == right)`
+// error-pattern: left: `14`
+// error-pattern:right: `15`
+
+fn main() {
+    assert_eq!(14, 15);
+}
diff --git a/src/test/ui/macros/assert-macro-explicit.rs b/src/test/ui/macros/assert-macro-explicit.rs
new file mode 100644
index 00000000000..da13c06d575
--- /dev/null
+++ b/src/test/ui/macros/assert-macro-explicit.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'assertion failed: false'
+
+fn main() {
+    assert!(false);
+}
diff --git a/src/test/ui/macros/assert-macro-fmt.rs b/src/test/ui/macros/assert-macro-fmt.rs
new file mode 100644
index 00000000000..3b173156d7a
--- /dev/null
+++ b/src/test/ui/macros/assert-macro-fmt.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'test-assert-fmt 42 rust'
+
+fn main() {
+    assert!(false, "test-assert-fmt {} {}", 42, "rust");
+}
diff --git a/src/test/ui/macros/assert-macro-owned.rs b/src/test/ui/macros/assert-macro-owned.rs
new file mode 100644
index 00000000000..c231ceb46e9
--- /dev/null
+++ b/src/test/ui/macros/assert-macro-owned.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'test-assert-owned'
+
+fn main() {
+    assert!(false, "test-assert-owned".to_string());
+}
diff --git a/src/test/ui/macros/assert-macro-static.rs b/src/test/ui/macros/assert-macro-static.rs
new file mode 100644
index 00000000000..3c988ba4469
--- /dev/null
+++ b/src/test/ui/macros/assert-macro-static.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'test-assert-static'
+
+fn main() {
+    assert!(false, "test-assert-static");
+}
diff --git a/src/test/ui/macros/assert-ne-macro-panic.rs b/src/test/ui/macros/assert-ne-macro-panic.rs
new file mode 100644
index 00000000000..0e505e58e2b
--- /dev/null
+++ b/src/test/ui/macros/assert-ne-macro-panic.rs
@@ -0,0 +1,8 @@
+// run-fail
+// error-pattern:assertion failed: `(left != right)`
+// error-pattern: left: `14`
+// error-pattern:right: `14`
+
+fn main() {
+    assert_ne!(14, 14);
+}
diff --git a/src/test/ui/macros/die-macro-2.rs b/src/test/ui/macros/die-macro-2.rs
new file mode 100644
index 00000000000..11a3222440d
--- /dev/null
+++ b/src/test/ui/macros/die-macro-2.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:test
+
+fn main() {
+    panic!("test");
+}
diff --git a/src/test/ui/macros/die-macro-expr.rs b/src/test/ui/macros/die-macro-expr.rs
new file mode 100644
index 00000000000..05f821acdf5
--- /dev/null
+++ b/src/test/ui/macros/die-macro-expr.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:test
+
+fn main() {
+    let __isize: isize = panic!("test");
+}
diff --git a/src/test/ui/macros/die-macro-pure.rs b/src/test/ui/macros/die-macro-pure.rs
new file mode 100644
index 00000000000..1a86a7c22cc
--- /dev/null
+++ b/src/test/ui/macros/die-macro-pure.rs
@@ -0,0 +1,10 @@
+// run-fail
+// error-pattern:test
+
+fn f() {
+    panic!("test");
+}
+
+fn main() {
+    f();
+}
diff --git a/src/test/ui/macros/unimplemented-macro-panic.rs b/src/test/ui/macros/unimplemented-macro-panic.rs
new file mode 100644
index 00000000000..37932ca7670
--- /dev/null
+++ b/src/test/ui/macros/unimplemented-macro-panic.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:not implemented
+
+fn main() {
+    unimplemented!()
+}
diff --git a/src/test/ui/macros/unreachable-fmt-msg.rs b/src/test/ui/macros/unreachable-fmt-msg.rs
new file mode 100644
index 00000000000..b2df8f82500
--- /dev/null
+++ b/src/test/ui/macros/unreachable-fmt-msg.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:internal error: entered unreachable code: 6 is not prime
+
+fn main() {
+    unreachable!("{} is not {}", 6u32, "prime");
+}
diff --git a/src/test/ui/macros/unreachable-macro-panic.rs b/src/test/ui/macros/unreachable-macro-panic.rs
new file mode 100644
index 00000000000..ad0d82feeaf
--- /dev/null
+++ b/src/test/ui/macros/unreachable-macro-panic.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:internal error: entered unreachable code
+
+fn main() {
+    unreachable!()
+}
diff --git a/src/test/ui/macros/unreachable-static-msg.rs b/src/test/ui/macros/unreachable-static-msg.rs
new file mode 100644
index 00000000000..b59d1960511
--- /dev/null
+++ b/src/test/ui/macros/unreachable-static-msg.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:internal error: entered unreachable code: uhoh
+
+fn main() {
+    unreachable!("uhoh")
+}
diff --git a/src/test/ui/macros/unreachable.rs b/src/test/ui/macros/unreachable.rs
new file mode 100644
index 00000000000..ad0d82feeaf
--- /dev/null
+++ b/src/test/ui/macros/unreachable.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:internal error: entered unreachable code
+
+fn main() {
+    unreachable!()
+}
diff --git a/src/test/ui/match/expr-match-panic-fn.rs b/src/test/ui/match/expr-match-panic-fn.rs
new file mode 100644
index 00000000000..c5bd7382f9f
--- /dev/null
+++ b/src/test/ui/match/expr-match-panic-fn.rs
@@ -0,0 +1,18 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn f() -> ! {
+    panic!()
+}
+
+fn g() -> isize {
+    let x = match true {
+        true => f(),
+        false => 10,
+    };
+    return x;
+}
+
+fn main() {
+    g();
+}
diff --git a/src/test/ui/match/expr-match-panic.rs b/src/test/ui/match/expr-match-panic.rs
new file mode 100644
index 00000000000..76144314fad
--- /dev/null
+++ b/src/test/ui/match/expr-match-panic.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn main() {
+    let _x = match true {
+        false => 0,
+        true => panic!(),
+    };
+}
diff --git a/src/test/ui/match/match-bot-panic.rs b/src/test/ui/match/match-bot-panic.rs
new file mode 100644
index 00000000000..8b147cb5ab6
--- /dev/null
+++ b/src/test/ui/match/match-bot-panic.rs
@@ -0,0 +1,15 @@
+// run-fail
+// error-pattern:explicit panic
+
+#![allow(unreachable_code)]
+#![allow(unused_variables)]
+
+fn foo(s: String) {}
+
+fn main() {
+    let i = match Some::<isize>(3) {
+        None::<isize> => panic!(),
+        Some::<isize>(_) => panic!(),
+    };
+    foo(i);
+}
diff --git a/src/test/ui/match/match-disc-bot.rs b/src/test/ui/match/match-disc-bot.rs
new file mode 100644
index 00000000000..785237b34af
--- /dev/null
+++ b/src/test/ui/match/match-disc-bot.rs
@@ -0,0 +1,15 @@
+// run-fail
+// error-pattern:quux
+
+fn f() -> ! {
+    panic!("quux")
+}
+fn g() -> isize {
+    match f() {
+        true => 1,
+        false => 0,
+    }
+}
+fn main() {
+    g();
+}
diff --git a/src/test/ui/match/match-wildcards.rs b/src/test/ui/match/match-wildcards.rs
new file mode 100644
index 00000000000..b79fd03c133
--- /dev/null
+++ b/src/test/ui/match/match-wildcards.rs
@@ -0,0 +1,20 @@
+// run-fail
+// error-pattern:squirrelcupcake
+
+fn cmp() -> isize {
+    match (Some('a'), None::<char>) {
+        (Some(_), _) => {
+            panic!("squirrelcupcake");
+        }
+        (_, Some(_)) => {
+            panic!();
+        }
+        _ => {
+            panic!("wat");
+        }
+    }
+}
+
+fn main() {
+    println!("{}", cmp());
+}
diff --git a/src/test/ui/meta-revision-bad.rs b/src/test/ui/meta-revision-bad.rs
new file mode 100644
index 00000000000..01f1518c1c6
--- /dev/null
+++ b/src/test/ui/meta-revision-bad.rs
@@ -0,0 +1,21 @@
+// Meta test for compiletest: check that when we give the wrong error
+// patterns, the test fails.
+
+// run-fail
+// revisions: foo bar
+// should-fail
+//[foo] error-pattern:bar
+//[bar] error-pattern:foo
+
+#[cfg(foo)]
+fn die() {
+    panic!("foo");
+}
+#[cfg(bar)]
+fn die() {
+    panic!("bar");
+}
+
+fn main() {
+    die();
+}
diff --git a/src/test/ui/meta-revision-ok.rs b/src/test/ui/meta-revision-ok.rs
new file mode 100644
index 00000000000..c77ce084a5c
--- /dev/null
+++ b/src/test/ui/meta-revision-ok.rs
@@ -0,0 +1,20 @@
+// Meta test for compiletest: check that when we give the right error
+// patterns, the test passes. See all `meta-revision-bad.rs`.
+
+// run-fail
+// revisions: foo bar
+//[foo] error-pattern:foo
+//[bar] error-pattern:bar
+
+#[cfg(foo)]
+fn die() {
+    panic!("foo");
+}
+#[cfg(bar)]
+fn die() {
+    panic!("bar");
+}
+
+fn main() {
+    die();
+}
diff --git a/src/test/ui/mir/mir_codegen_calls_converging_drops.rs b/src/test/ui/mir/mir_codegen_calls_converging_drops.rs
new file mode 100644
index 00000000000..7b31c1aa12e
--- /dev/null
+++ b/src/test/ui/mir/mir_codegen_calls_converging_drops.rs
@@ -0,0 +1,25 @@
+// run-fail
+// error-pattern:converging_fn called
+// error-pattern:0 dropped
+// error-pattern:exit
+
+struct Droppable(u8);
+impl Drop for Droppable {
+    fn drop(&mut self) {
+        eprintln!("{} dropped", self.0);
+    }
+}
+
+fn converging_fn() {
+    eprintln!("converging_fn called");
+}
+
+fn mir(d: Droppable) {
+    converging_fn();
+}
+
+fn main() {
+    let d = Droppable(0);
+    mir(d);
+    panic!("exit");
+}
diff --git a/src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs b/src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs
new file mode 100644
index 00000000000..f8117887c90
--- /dev/null
+++ b/src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs
@@ -0,0 +1,29 @@
+// run-fail
+// error-pattern:complex called
+// error-pattern:dropped
+// error-pattern:exit
+
+struct Droppable;
+impl Drop for Droppable {
+    fn drop(&mut self) {
+        eprintln!("dropped");
+    }
+}
+
+// return value of this function is copied into the return slot
+fn complex() -> u64 {
+    eprintln!("complex called");
+    42
+}
+
+
+fn mir() -> u64 {
+    let x = Droppable;
+    return complex();
+    drop(x);
+}
+
+pub fn main() {
+    assert_eq!(mir(), 42);
+    panic!("exit");
+}
diff --git a/src/test/ui/mir/mir_codegen_calls_diverging.rs b/src/test/ui/mir/mir_codegen_calls_diverging.rs
new file mode 100644
index 00000000000..96630da4d49
--- /dev/null
+++ b/src/test/ui/mir/mir_codegen_calls_diverging.rs
@@ -0,0 +1,14 @@
+// run-fail
+// error-pattern:diverging_fn called
+
+fn diverging_fn() -> ! {
+    panic!("diverging_fn called")
+}
+
+fn mir() {
+    diverging_fn();
+}
+
+fn main() {
+    mir();
+}
diff --git a/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs b/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs
new file mode 100644
index 00000000000..96a03a0d6a7
--- /dev/null
+++ b/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs
@@ -0,0 +1,23 @@
+// run-fail
+// error-pattern:diverging_fn called
+// error-pattern:0 dropped
+
+struct Droppable(u8);
+impl Drop for Droppable {
+    fn drop(&mut self) {
+        eprintln!("{} dropped", self.0);
+    }
+}
+
+fn diverging_fn() -> ! {
+    panic!("diverging_fn called")
+}
+
+fn mir(d: Droppable) {
+    diverging_fn();
+}
+
+fn main() {
+    let d = Droppable(0);
+    mir(d);
+}
diff --git a/src/test/ui/mir/mir_drop_panics.rs b/src/test/ui/mir/mir_drop_panics.rs
new file mode 100644
index 00000000000..da6d0b6a346
--- /dev/null
+++ b/src/test/ui/mir/mir_drop_panics.rs
@@ -0,0 +1,23 @@
+// run-fail
+// error-pattern:panic 1
+// error-pattern:drop 2
+
+struct Droppable(u32);
+impl Drop for Droppable {
+    fn drop(&mut self) {
+        if self.0 == 1 {
+            panic!("panic 1");
+        } else {
+            eprintln!("drop {}", self.0);
+        }
+    }
+}
+
+fn mir() {
+    let x = Droppable(2);
+    let y = Droppable(1);
+}
+
+fn main() {
+    mir();
+}
diff --git a/src/test/ui/mir/mir_dynamic_drops_1.rs b/src/test/ui/mir/mir_dynamic_drops_1.rs
new file mode 100644
index 00000000000..524f13d754d
--- /dev/null
+++ b/src/test/ui/mir/mir_dynamic_drops_1.rs
@@ -0,0 +1,31 @@
+// run-fail
+// error-pattern:drop 1
+// error-pattern:drop 2
+// ignore-cloudabi no std::process
+
+/// Structure which will not allow to be dropped twice.
+struct Droppable<'a>(&'a mut bool, u32);
+impl<'a> Drop for Droppable<'a> {
+    fn drop(&mut self) {
+        if *self.0 {
+            eprintln!("{} dropped twice", self.1);
+            ::std::process::exit(1);
+        }
+        eprintln!("drop {}", self.1);
+        *self.0 = true;
+    }
+}
+
+fn mir() {
+    let (mut xv, mut yv) = (false, false);
+    let x = Droppable(&mut xv, 1);
+    let y = Droppable(&mut yv, 2);
+    let mut z = x;
+    let k = y;
+    z = k;
+}
+
+fn main() {
+    mir();
+    panic!();
+}
diff --git a/src/test/ui/mir/mir_dynamic_drops_2.rs b/src/test/ui/mir/mir_dynamic_drops_2.rs
new file mode 100644
index 00000000000..8415b99bcf9
--- /dev/null
+++ b/src/test/ui/mir/mir_dynamic_drops_2.rs
@@ -0,0 +1,29 @@
+// run-fail
+// error-pattern:drop 1
+// ignore-cloudabi no std::process
+
+/// Structure which will not allow to be dropped twice.
+struct Droppable<'a>(&'a mut bool, u32);
+impl<'a> Drop for Droppable<'a> {
+    fn drop(&mut self) {
+        if *self.0 {
+            eprintln!("{} dropped twice", self.1);
+            ::std::process::exit(1);
+        }
+        eprintln!("drop {}", self.1);
+        *self.0 = true;
+    }
+}
+
+fn mir<'a>(d: Droppable<'a>) {
+    loop {
+        let x = d;
+        break;
+    }
+}
+
+fn main() {
+    let mut xv = false;
+    mir(Droppable(&mut xv, 1));
+    panic!();
+}
diff --git a/src/test/ui/mir/mir_dynamic_drops_3.rs b/src/test/ui/mir/mir_dynamic_drops_3.rs
new file mode 100644
index 00000000000..18914fdb03d
--- /dev/null
+++ b/src/test/ui/mir/mir_dynamic_drops_3.rs
@@ -0,0 +1,34 @@
+// run-fail
+// error-pattern:unwind happens
+// error-pattern:drop 3
+// error-pattern:drop 2
+// error-pattern:drop 1
+// ignore-cloudabi no std::process
+
+/// Structure which will not allow to be dropped twice.
+struct Droppable<'a>(&'a mut bool, u32);
+impl<'a> Drop for Droppable<'a> {
+    fn drop(&mut self) {
+        if *self.0 {
+            eprintln!("{} dropped twice", self.1);
+            ::std::process::exit(1);
+        }
+        eprintln!("drop {}", self.1);
+        *self.0 = true;
+    }
+}
+
+fn may_panic<'a>() -> Droppable<'a> {
+    panic!("unwind happens");
+}
+
+fn mir<'a>(d: Droppable<'a>) {
+    let (mut a, mut b) = (false, false);
+    let y = Droppable(&mut a, 2);
+    let x = [Droppable(&mut b, 1), y, d, may_panic()];
+}
+
+fn main() {
+    let mut c = false;
+    mir(Droppable(&mut c, 3));
+}
diff --git a/src/test/ui/mir/mir_indexing_oob_1.rs b/src/test/ui/mir/mir_indexing_oob_1.rs
new file mode 100644
index 00000000000..d46d3704779
--- /dev/null
+++ b/src/test/ui/mir/mir_indexing_oob_1.rs
@@ -0,0 +1,13 @@
+// run-fail
+// error-pattern:index out of bounds: the len is 5 but the index is 10
+
+const C: [u32; 5] = [0; 5];
+
+#[allow(unconditional_panic)]
+fn test() -> u32 {
+    C[10]
+}
+
+fn main() {
+    test();
+}
diff --git a/src/test/ui/mir/mir_indexing_oob_2.rs b/src/test/ui/mir/mir_indexing_oob_2.rs
new file mode 100644
index 00000000000..03b3ea01d6b
--- /dev/null
+++ b/src/test/ui/mir/mir_indexing_oob_2.rs
@@ -0,0 +1,13 @@
+// run-fail
+// error-pattern:index out of bounds: the len is 5 but the index is 10
+
+const C: &'static [u8; 5] = b"hello";
+
+#[allow(unconditional_panic)]
+fn test() -> u8 {
+    C[10]
+}
+
+fn main() {
+    test();
+}
diff --git a/src/test/ui/mir/mir_indexing_oob_3.rs b/src/test/ui/mir/mir_indexing_oob_3.rs
new file mode 100644
index 00000000000..023d65c4bd0
--- /dev/null
+++ b/src/test/ui/mir/mir_indexing_oob_3.rs
@@ -0,0 +1,13 @@
+// run-fail
+// error-pattern:index out of bounds: the len is 5 but the index is 10
+
+const C: &'static [u8; 5] = b"hello";
+
+#[allow(unconditional_panic)]
+fn mir() -> u8 {
+    C[10]
+}
+
+fn main() {
+    mir();
+}
diff --git a/src/test/ui/never_type/return-never-coerce.rs b/src/test/ui/never_type/return-never-coerce.rs
new file mode 100644
index 00000000000..fa0c78c2cf3
--- /dev/null
+++ b/src/test/ui/never_type/return-never-coerce.rs
@@ -0,0 +1,17 @@
+// Test that ! coerces to other types.
+
+// run-fail
+// error-pattern:aah!
+
+fn call_another_fn<T, F: FnOnce() -> T>(f: F) -> T {
+    f()
+}
+
+fn wub() -> ! {
+    panic!("aah!");
+}
+
+fn main() {
+    let x: i32 = call_another_fn(wub);
+    let y: u32 = wub();
+}
diff --git a/src/test/ui/numbers-arithmetic/divide-by-zero.rs b/src/test/ui/numbers-arithmetic/divide-by-zero.rs
new file mode 100644
index 00000000000..fcbc23b8367
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/divide-by-zero.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:attempt to divide by zero
+#[allow(unconditional_panic)]
+fn main() {
+    let y = 0;
+    let _z = 1 / y;
+}
diff --git a/src/test/ui/numbers-arithmetic/mod-zero.rs b/src/test/ui/numbers-arithmetic/mod-zero.rs
new file mode 100644
index 00000000000..a2798175d68
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/mod-zero.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:attempt to calculate the remainder with a divisor of zero
+#[allow(unconditional_panic)]
+fn main() {
+    let y = 0;
+    let _z = 1 % y;
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-add.rs b/src/test/ui/numbers-arithmetic/overflowing-add.rs
new file mode 100644
index 00000000000..7d63fe3d20b
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-add.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:thread 'main' panicked at 'attempt to add with overflow'
+// compile-flags: -C debug-assertions
+
+#![allow(arithmetic_overflow)]
+
+fn main() {
+    let _x = 200u8 + 200u8 + 200u8;
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs
new file mode 100644
index 00000000000..e5ce8033639
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    let _x = 1_i32 << 32;
+    //~^ ERROR: this arithmetic operation will overflow
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr
new file mode 100644
index 00000000000..54008d33968
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-lsh-1.rs:7:14
+   |
+LL |     let _x = 1_i32 << 32;
+   |              ^^^^^^^^^^^ attempt to shift left with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-lsh-1.rs:4:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs
new file mode 100644
index 00000000000..7fd3407a056
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    let _x = 1 << -1;
+    //~^ ERROR: this arithmetic operation will overflow
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr
new file mode 100644
index 00000000000..872e71bb737
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-lsh-2.rs:7:14
+   |
+LL |     let _x = 1 << -1;
+   |              ^^^^^^^ attempt to shift left with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-lsh-2.rs:4:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs
new file mode 100644
index 00000000000..e007eb4a2e2
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    let _x = 1_u64 << 64;
+    //~^ ERROR: this arithmetic operation will overflow
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr
new file mode 100644
index 00000000000..d55ed4a046c
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-lsh-3.rs:7:14
+   |
+LL |     let _x = 1_u64 << 64;
+   |              ^^^^^^^^^^^ attempt to shift left with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-lsh-3.rs:4:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs
new file mode 100644
index 00000000000..738d0133915
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs
@@ -0,0 +1,24 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+// This function is checking that our automatic truncation does not
+// sidestep the overflow checking.
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    // this signals overflow when checking is on
+    let x = 1_i8 << 17;
+    //~^ ERROR: this arithmetic operation will overflow
+
+    // ... but when checking is off, the fallback will truncate the
+    // input to its lower three bits (= 1). Note that this is *not*
+    // the behavior of the x86 processor for 8- and 16-bit types,
+    // but it is necessary to avoid undefined behavior from LLVM.
+    //
+    // We check that here, by ensuring the result has only been
+    // shifted by one place; if overflow checking is turned off, then
+    // this assertion will pass (and the compiletest driver will
+    // report that the test did not produce the error expected above).
+    assert_eq!(x, 2_i8);
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr
new file mode 100644
index 00000000000..1ef8dd3466c
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-lsh-4.rs:11:13
+   |
+LL |     let x = 1_i8 << 17;
+   |             ^^^^^^^^^^ attempt to shift left with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-lsh-4.rs:7:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-mul.rs b/src/test/ui/numbers-arithmetic/overflowing-mul.rs
new file mode 100644
index 00000000000..6e17aeb6761
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-mul.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
+// compile-flags: -C debug-assertions
+
+#![allow(arithmetic_overflow)]
+
+fn main() {
+    let x = 200u8 * 4;
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-neg.rs b/src/test/ui/numbers-arithmetic/overflowing-neg.rs
new file mode 100644
index 00000000000..f77bc132e76
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-neg.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:thread 'main' panicked at 'attempt to negate with overflow'
+// compile-flags: -C debug-assertions
+
+#![allow(arithmetic_overflow)]
+
+fn main() {
+    let _x = -std::i8::MIN;
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs b/src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs
new file mode 100644
index 00000000000..a855ef0ec06
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
+// compile-flags: -C debug-assertions
+
+fn main() {
+    let _x = 2i32.pow(1024);
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs b/src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs
new file mode 100644
index 00000000000..26a2b2c4b8a
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
+// compile-flags: -C debug-assertions
+
+fn main() {
+    let _x = 2u32.pow(1024);
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs
new file mode 100644
index 00000000000..f1488cf8559
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    let _x = -1_i32 >> 32;
+    //~^ ERROR: this arithmetic operation will overflow
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr
new file mode 100644
index 00000000000..236303e2e9a
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-rsh-1.rs:7:14
+   |
+LL |     let _x = -1_i32 >> 32;
+   |              ^^^^^^^^^^^^ attempt to shift right with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-rsh-1.rs:4:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs
new file mode 100644
index 00000000000..39127b9703b
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    let _x = -1_i32 >> -1;
+    //~^ ERROR: this arithmetic operation will overflow
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr
new file mode 100644
index 00000000000..981c8986f76
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-rsh-2.rs:7:14
+   |
+LL |     let _x = -1_i32 >> -1;
+   |              ^^^^^^^^^^^^ attempt to shift right with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-rsh-2.rs:4:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs
new file mode 100644
index 00000000000..8ee6dde93ea
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    let _x = -1_i64 >> 64;
+    //~^ ERROR: this arithmetic operation will overflow
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr
new file mode 100644
index 00000000000..c2994503f0e
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-rsh-3.rs:7:14
+   |
+LL |     let _x = -1_i64 >> 64;
+   |              ^^^^^^^^^^^^ attempt to shift right with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-rsh-3.rs:4:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs
new file mode 100644
index 00000000000..ce7f818e330
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs
@@ -0,0 +1,24 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+// This function is checking that our (type-based) automatic
+// truncation does not sidestep the overflow checking.
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    // this signals overflow when checking is on
+    let x = 2_i8 >> 17;
+    //~^ ERROR: this arithmetic operation will overflow
+
+    // ... but when checking is off, the fallback will truncate the
+    // input to its lower three bits (= 1). Note that this is *not*
+    // the behavior of the x86 processor for 8- and 16-bit types,
+    // but it is necessary to avoid undefined behavior from LLVM.
+    //
+    // We check that here, by ensuring the result is not zero; if
+    // overflow checking is turned off, then this assertion will pass
+    // (and the compiletest driver will report that the test did not
+    // produce the error expected above).
+    assert_eq!(x, 1_i8);
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr
new file mode 100644
index 00000000000..3db1da06dbe
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-rsh-4.rs:11:13
+   |
+LL |     let x = 2_i8 >> 17;
+   |             ^^^^^^^^^^ attempt to shift right with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-rsh-4.rs:7:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs
new file mode 100644
index 00000000000..88928c99596
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    let _n = 1i64 >> [64][0];
+    //~^ ERROR: this arithmetic operation will overflow
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr
new file mode 100644
index 00000000000..bd3eae82977
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-rsh-5.rs:7:14
+   |
+LL |     let _n = 1i64 >> [64][0];
+   |              ^^^^^^^^^^^^^^^ attempt to shift right with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-rsh-5.rs:4:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs
new file mode 100644
index 00000000000..88928c99596
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: -C debug-assertions
+
+#![deny(arithmetic_overflow, const_err)]
+
+fn main() {
+    let _n = 1i64 >> [64][0];
+    //~^ ERROR: this arithmetic operation will overflow
+}
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr
new file mode 100644
index 00000000000..5d76639fb50
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr
@@ -0,0 +1,14 @@
+error: this arithmetic operation will overflow
+  --> $DIR/overflowing-rsh-6.rs:7:14
+   |
+LL |     let _n = 1i64 >> [64][0];
+   |              ^^^^^^^^^^^^^^^ attempt to shift right with overflow
+   |
+note: the lint level is defined here
+  --> $DIR/overflowing-rsh-6.rs:4:9
+   |
+LL | #![deny(arithmetic_overflow, const_err)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/numbers-arithmetic/overflowing-sub.rs b/src/test/ui/numbers-arithmetic/overflowing-sub.rs
new file mode 100644
index 00000000000..2e2ee521247
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/overflowing-sub.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:thread 'main' panicked at 'attempt to subtract with overflow'
+// compile-flags: -C debug-assertions
+
+#![allow(arithmetic_overflow)]
+
+fn main() {
+    let _x = 42u8 - (42u8 + 1);
+}
diff --git a/src/test/ui/numbers-arithmetic/promoted_overflow.rs b/src/test/ui/numbers-arithmetic/promoted_overflow.rs
new file mode 100644
index 00000000000..da59e81ed6b
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/promoted_overflow.rs
@@ -0,0 +1,9 @@
+#![allow(arithmetic_overflow)]
+
+// run-fail
+// error-pattern: overflow
+// compile-flags: -C overflow-checks=yes
+
+fn main() {
+    let x: &'static u32 = &(0u32 - 1);
+}
diff --git a/src/test/ui/panic-runtime/unwind-interleaved.rs b/src/test/ui/panic-runtime/unwind-interleaved.rs
new file mode 100644
index 00000000000..3d2b8a69480
--- /dev/null
+++ b/src/test/ui/panic-runtime/unwind-interleaved.rs
@@ -0,0 +1,15 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn a() {}
+
+fn b() {
+    panic!();
+}
+
+fn main() {
+    let _x = vec![0];
+    a();
+    let _y = vec![0];
+    b();
+}
diff --git a/src/test/ui/panic-runtime/unwind-rec.rs b/src/test/ui/panic-runtime/unwind-rec.rs
new file mode 100644
index 00000000000..88aa6a577e6
--- /dev/null
+++ b/src/test/ui/panic-runtime/unwind-rec.rs
@@ -0,0 +1,14 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn build() -> Vec<isize> {
+    panic!();
+}
+
+struct Blk {
+    node: Vec<isize>,
+}
+
+fn main() {
+    let _blk = Blk { node: build() };
+}
diff --git a/src/test/ui/panic-runtime/unwind-rec2.rs b/src/test/ui/panic-runtime/unwind-rec2.rs
new file mode 100644
index 00000000000..b3cac5141bb
--- /dev/null
+++ b/src/test/ui/panic-runtime/unwind-rec2.rs
@@ -0,0 +1,22 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn build1() -> Vec<isize> {
+    vec![0, 0, 0, 0, 0, 0, 0]
+}
+
+fn build2() -> Vec<isize> {
+    panic!();
+}
+
+struct Blk {
+    node: Vec<isize>,
+    span: Vec<isize>,
+}
+
+fn main() {
+    let _blk = Blk {
+        node: build1(),
+        span: build2(),
+    };
+}
diff --git a/src/test/ui/panic-runtime/unwind-unique.rs b/src/test/ui/panic-runtime/unwind-unique.rs
new file mode 100644
index 00000000000..fabd28ac4f9
--- /dev/null
+++ b/src/test/ui/panic-runtime/unwind-unique.rs
@@ -0,0 +1,11 @@
+// run-fail
+// error-pattern:explicit panic
+
+fn failfn() {
+    panic!();
+}
+
+fn main() {
+    Box::new(0);
+    failfn();
+}
diff --git a/src/test/ui/panics/args-panic.rs b/src/test/ui/panics/args-panic.rs
new file mode 100644
index 00000000000..cdf1ef44752
--- /dev/null
+++ b/src/test/ui/panics/args-panic.rs
@@ -0,0 +1,12 @@
+// run-fail
+// error-pattern:meep
+
+#![feature(box_syntax)]
+
+fn f(_a: isize, _b: isize, _c: Box<isize>) {
+    panic!("moop");
+}
+
+fn main() {
+    f(1, panic!("meep"), box 42);
+}
diff --git a/src/test/ui/panics/doublepanic.rs b/src/test/ui/panics/doublepanic.rs
new file mode 100644
index 00000000000..0b6ac6fe410
--- /dev/null
+++ b/src/test/ui/panics/doublepanic.rs
@@ -0,0 +1,9 @@
+#![allow(unreachable_code)]
+
+// run-fail
+// error-pattern:One
+
+fn main() {
+    panic!("One");
+    panic!("Two");
+}
diff --git a/src/test/ui/panics/explicit-panic-msg.rs b/src/test/ui/panics/explicit-panic-msg.rs
new file mode 100644
index 00000000000..d27fc3e06f1
--- /dev/null
+++ b/src/test/ui/panics/explicit-panic-msg.rs
@@ -0,0 +1,13 @@
+#![allow(unused_assignments)]
+#![allow(unused_variables)]
+
+// run-fail
+// error-pattern:wooooo
+
+fn main() {
+    let mut a = 1;
+    if 1 == 1 {
+        a = 2;
+    }
+    panic!(format!("woooo{}", "o"));
+}
diff --git a/src/test/ui/panics/explicit-panic.rs b/src/test/ui/panics/explicit-panic.rs
new file mode 100644
index 00000000000..ddd5f00be6e
--- /dev/null
+++ b/src/test/ui/panics/explicit-panic.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:explicit
+
+fn main() {
+    panic!();
+}
diff --git a/src/test/ui/panics/fmt-panic.rs b/src/test/ui/panics/fmt-panic.rs
new file mode 100644
index 00000000000..8024f7b6166
--- /dev/null
+++ b/src/test/ui/panics/fmt-panic.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:meh
+
+fn main() {
+    let str_var: String = "meh".to_string();
+    panic!("{}", str_var);
+}
diff --git a/src/test/ui/panics/main-panic.rs b/src/test/ui/panics/main-panic.rs
new file mode 100644
index 00000000000..34bd9f8e0c6
--- /dev/null
+++ b/src/test/ui/panics/main-panic.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:thread 'main' panicked at
+
+fn main() {
+    panic!()
+}
diff --git a/src/test/ui/panics/panic-arg.rs b/src/test/ui/panics/panic-arg.rs
new file mode 100644
index 00000000000..b73487d083c
--- /dev/null
+++ b/src/test/ui/panics/panic-arg.rs
@@ -0,0 +1,10 @@
+// run-fail
+// error-pattern:woe
+
+fn f(a: isize) {
+    println!("{}", a);
+}
+
+fn main() {
+    f(panic!("woe"));
+}
diff --git a/src/test/ui/panics/panic-macro-any-wrapped.rs b/src/test/ui/panics/panic-macro-any-wrapped.rs
new file mode 100644
index 00000000000..85737e947a1
--- /dev/null
+++ b/src/test/ui/panics/panic-macro-any-wrapped.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'Box<Any>'
+
+fn main() {
+    panic!(Box::new(612_i64));
+}
diff --git a/src/test/ui/panics/panic-macro-any.rs b/src/test/ui/panics/panic-macro-any.rs
new file mode 100644
index 00000000000..0d9eec17eb7
--- /dev/null
+++ b/src/test/ui/panics/panic-macro-any.rs
@@ -0,0 +1,8 @@
+// run-fail
+// error-pattern:panicked at 'Box<Any>'
+
+#![feature(box_syntax)]
+
+fn main() {
+    panic!(box 413 as Box<dyn std::any::Any + Send>);
+}
diff --git a/src/test/ui/panics/panic-macro-explicit.rs b/src/test/ui/panics/panic-macro-explicit.rs
new file mode 100644
index 00000000000..f27bdda3f32
--- /dev/null
+++ b/src/test/ui/panics/panic-macro-explicit.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'explicit panic'
+
+fn main() {
+    panic!();
+}
diff --git a/src/test/ui/panics/panic-macro-fmt.rs b/src/test/ui/panics/panic-macro-fmt.rs
new file mode 100644
index 00000000000..c18d7830d06
--- /dev/null
+++ b/src/test/ui/panics/panic-macro-fmt.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'test-fail-fmt 42 rust'
+
+fn main() {
+    panic!("test-fail-fmt {} {}", 42, "rust");
+}
diff --git a/src/test/ui/panics/panic-macro-owned.rs b/src/test/ui/panics/panic-macro-owned.rs
new file mode 100644
index 00000000000..fd56cfa3bb8
--- /dev/null
+++ b/src/test/ui/panics/panic-macro-owned.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'test-fail-owned'
+
+fn main() {
+    panic!("test-fail-owned");
+}
diff --git a/src/test/ui/panics/panic-macro-static.rs b/src/test/ui/panics/panic-macro-static.rs
new file mode 100644
index 00000000000..a78732ed398
--- /dev/null
+++ b/src/test/ui/panics/panic-macro-static.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:panicked at 'test-fail-static'
+
+fn main() {
+    panic!("test-fail-static");
+}
diff --git a/src/test/ui/panics/panic-main.rs b/src/test/ui/panics/panic-main.rs
new file mode 100644
index 00000000000..17ad25e3686
--- /dev/null
+++ b/src/test/ui/panics/panic-main.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:moop
+
+fn main() {
+    panic!("moop");
+}
diff --git a/src/test/ui/panics/panic-parens.rs b/src/test/ui/panics/panic-parens.rs
new file mode 100644
index 00000000000..8052c78cc63
--- /dev/null
+++ b/src/test/ui/panics/panic-parens.rs
@@ -0,0 +1,18 @@
+// Fail macros without arguments need to be disambiguated in
+// certain positions
+// run-fail
+// error-pattern:oops
+
+fn bigpanic() {
+    while (panic!("oops")) {
+        if (panic!()) {
+            match (panic!()) {
+                () => {}
+            }
+        }
+    }
+}
+
+fn main() {
+    bigpanic();
+}
diff --git a/src/test/ui/panics/panic-set-handler.rs b/src/test/ui/panics/panic-set-handler.rs
new file mode 100644
index 00000000000..55542e58433
--- /dev/null
+++ b/src/test/ui/panics/panic-set-handler.rs
@@ -0,0 +1,11 @@
+// run-fail
+// error-pattern:greetings from the panic handler
+
+use std::panic;
+
+fn main() {
+    panic::set_hook(Box::new(|i| {
+        eprintln!("greetings from the panic handler");
+    }));
+    panic!("foobar");
+}
diff --git a/src/test/ui/panics/panic-set-unset-handler.rs b/src/test/ui/panics/panic-set-unset-handler.rs
new file mode 100644
index 00000000000..6b4c047eaf2
--- /dev/null
+++ b/src/test/ui/panics/panic-set-unset-handler.rs
@@ -0,0 +1,12 @@
+// run-fail
+// error-pattern:thread 'main' panicked at 'foobar'
+
+use std::panic;
+
+fn main() {
+    panic::set_hook(Box::new(|i| {
+        eprint!("greetings from the panic handler");
+    }));
+    panic::take_hook();
+    panic!("foobar");
+}
diff --git a/src/test/ui/panics/panic-take-handler-nop.rs b/src/test/ui/panics/panic-take-handler-nop.rs
new file mode 100644
index 00000000000..e519209a5a6
--- /dev/null
+++ b/src/test/ui/panics/panic-take-handler-nop.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:thread 'main' panicked at 'foobar'
+
+use std::panic;
+
+fn main() {
+    panic::take_hook();
+    panic!("foobar");
+}
diff --git a/src/test/ui/panics/panic-task-name-none.rs b/src/test/ui/panics/panic-task-name-none.rs
new file mode 100644
index 00000000000..4e95fb5bdb8
--- /dev/null
+++ b/src/test/ui/panics/panic-task-name-none.rs
@@ -0,0 +1,13 @@
+// run-fail
+// error-pattern:thread '<unnamed>' panicked at 'test'
+// ignore-emscripten Needs threads
+
+use std::thread;
+
+fn main() {
+    let r: Result<(), _> = thread::spawn(move || {
+                               panic!("test");
+                           })
+                               .join();
+    assert!(r.is_ok());
+}
diff --git a/src/test/ui/panics/panic-task-name-owned.rs b/src/test/ui/panics/panic-task-name-owned.rs
new file mode 100644
index 00000000000..f85be7bb8e2
--- /dev/null
+++ b/src/test/ui/panics/panic-task-name-owned.rs
@@ -0,0 +1,18 @@
+// run-fail
+// error-pattern:thread 'owned name' panicked at 'test'
+// ignore-emscripten Needs threads.
+
+use std::thread::Builder;
+
+fn main() {
+    let r: () = Builder::new()
+                    .name("owned name".to_string())
+                    .spawn(move || {
+                        panic!("test");
+                        ()
+                    })
+                    .unwrap()
+                    .join()
+                    .unwrap();
+    panic!();
+}
diff --git a/src/test/ui/panics/panic.rs b/src/test/ui/panics/panic.rs
new file mode 100644
index 00000000000..7e8ea8b8175
--- /dev/null
+++ b/src/test/ui/panics/panic.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:1 == 2
+
+fn main() {
+    assert!(1 == 2);
+}
diff --git a/src/test/ui/panics/result-get-panic.rs b/src/test/ui/panics/result-get-panic.rs
new file mode 100644
index 00000000000..41bc13bf085
--- /dev/null
+++ b/src/test/ui/panics/result-get-panic.rs
@@ -0,0 +1,8 @@
+// run-fail
+// error-pattern:called `Result::unwrap()` on an `Err` value
+
+use std::result::Result::Err;
+
+fn main() {
+    println!("{}", Err::<isize, String>("kitty".to_string()).unwrap());
+}
diff --git a/src/test/ui/panics/test-panic.rs b/src/test/ui/panics/test-panic.rs
new file mode 100644
index 00000000000..85c9279cdf2
--- /dev/null
+++ b/src/test/ui/panics/test-panic.rs
@@ -0,0 +1,9 @@
+// run-fail
+// check-stdout
+// compile-flags: --test
+// ignore-emscripten
+
+#[test]
+fn test_foo() {
+    panic!()
+}
diff --git a/src/test/ui/panics/test-should-fail-bad-message.rs b/src/test/ui/panics/test-should-fail-bad-message.rs
new file mode 100644
index 00000000000..701f2677648
--- /dev/null
+++ b/src/test/ui/panics/test-should-fail-bad-message.rs
@@ -0,0 +1,10 @@
+// run-fail
+// check-stdout
+// compile-flags: --test
+// ignore-emscripten
+
+#[test]
+#[should_panic(expected = "foobar")]
+fn test_foo() {
+    panic!("blah")
+}
diff --git a/src/test/ui/panics/test-should-panic-bad-message.rs b/src/test/ui/panics/test-should-panic-bad-message.rs
new file mode 100644
index 00000000000..a90d67a7d6b
--- /dev/null
+++ b/src/test/ui/panics/test-should-panic-bad-message.rs
@@ -0,0 +1,9 @@
+// run-fail
+// compile-flags: --test
+// check-stdout
+
+#[test]
+#[should_panic(expected = "foo")]
+pub fn test_bar() {
+    panic!("bar")
+}
diff --git a/src/test/ui/panics/test-should-panic-no-message.rs b/src/test/ui/panics/test-should-panic-no-message.rs
new file mode 100644
index 00000000000..217267d2d75
--- /dev/null
+++ b/src/test/ui/panics/test-should-panic-no-message.rs
@@ -0,0 +1,9 @@
+// run-fail
+// compile-flags: --test
+// check-stdout
+
+#[test]
+#[should_panic(expected = "foo")]
+pub fn test_explicit() {
+    panic!()
+}
diff --git a/src/test/ui/panics/unique-panic.rs b/src/test/ui/panics/unique-panic.rs
new file mode 100644
index 00000000000..22e0d63d594
--- /dev/null
+++ b/src/test/ui/panics/unique-panic.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern: panic
+
+fn main() {
+    Box::new(panic!());
+}
diff --git a/src/test/ui/panics/while-body-panics.rs b/src/test/ui/panics/while-body-panics.rs
new file mode 100644
index 00000000000..b335c90a073
--- /dev/null
+++ b/src/test/ui/panics/while-body-panics.rs
@@ -0,0 +1,13 @@
+#![allow(while_true)]
+
+// run-fail
+// error-pattern:quux
+
+fn main() {
+    let _x: isize = {
+        while true {
+            panic!("quux");
+        }
+        8
+    };
+}
diff --git a/src/test/ui/panics/while-panic.rs b/src/test/ui/panics/while-panic.rs
new file mode 100644
index 00000000000..45be38418e0
--- /dev/null
+++ b/src/test/ui/panics/while-panic.rs
@@ -0,0 +1,13 @@
+#![allow(while_true)]
+
+// run-fail
+// error-pattern:giraffe
+
+fn main() {
+    panic!({
+        while true {
+            panic!("giraffe")
+        }
+        "clandestine"
+    });
+}
diff --git a/src/test/ui/process/tls-exit-status.rs b/src/test/ui/process/tls-exit-status.rs
new file mode 100644
index 00000000000..973bb9c4f0c
--- /dev/null
+++ b/src/test/ui/process/tls-exit-status.rs
@@ -0,0 +1,11 @@
+// run-fail
+// error-pattern:nonzero
+// exec-env:RUST_NEWRT=1
+// ignore-cloudabi no std::env
+
+use std::env;
+
+fn main() {
+    env::args();
+    panic!("please have a nonzero exit status");
+}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
new file mode 100644
index 00000000000..724ce509041
--- /dev/null
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
@@ -0,0 +1,10 @@
+// run-fail
+// error-pattern:returned Box<dyn Error> from main()
+// failure-status: 1
+
+use std::error::Error;
+use std::io;
+
+fn main() -> Result<(), Box<dyn Error>> {
+    Err(Box::new(io::Error::new(io::ErrorKind::Other, "returned Box<dyn Error> from main()")))
+}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs
new file mode 100644
index 00000000000..d5b6b5016d4
--- /dev/null
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs
@@ -0,0 +1,6 @@
+// run-fail
+// error-pattern:oh, dear
+
+fn main() -> ! {
+    panic!("oh, dear");
+}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs
new file mode 100644
index 00000000000..a99480e57ab
--- /dev/null
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:returned Box<Error> from main()
+// failure-status: 1
+
+use std::io::{Error, ErrorKind};
+
+fn main() -> Result<(), Box<Error>> {
+    Err(Box::new(Error::new(ErrorKind::Other, "returned Box<Error> from main()")))
+}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs
new file mode 100644
index 00000000000..c78477e4eee
--- /dev/null
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern: An error message for you
+// failure-status: 1
+
+fn main() -> Result<(), &'static str> {
+    Err("An error message for you")
+}
diff --git a/src/test/ui/str/str-overrun.rs b/src/test/ui/str/str-overrun.rs
new file mode 100644
index 00000000000..78bbf0cfdb9
--- /dev/null
+++ b/src/test/ui/str/str-overrun.rs
@@ -0,0 +1,9 @@
+// run-fail
+// error-pattern:index out of bounds: the len is 5 but the index is 5
+
+fn main() {
+    let s: String = "hello".to_string();
+
+    // Bounds-check panic.
+    assert_eq!(s.as_bytes()[5], 0x0 as u8);
+}
diff --git a/src/test/ui/structs/rhs-type.rs b/src/test/ui/structs/rhs-type.rs
new file mode 100644
index 00000000000..dd227a7f0a0
--- /dev/null
+++ b/src/test/ui/structs/rhs-type.rs
@@ -0,0 +1,17 @@
+// Tests that codegen treats the rhs of pth's decl
+// as a _|_-typed thing, not a str-typed thing
+
+// run-fail
+// error-pattern:bye
+
+#![allow(unreachable_code)]
+#![allow(unused_variables)]
+
+struct T {
+    t: String,
+}
+
+fn main() {
+    let pth = panic!("bye");
+    let _rs: T = T { t: pth };
+}
diff --git a/src/test/ui/test-attrs/run-unexported-tests.rs b/src/test/ui/test-attrs/run-unexported-tests.rs
new file mode 100644
index 00000000000..f533a3ef885
--- /dev/null
+++ b/src/test/ui/test-attrs/run-unexported-tests.rs
@@ -0,0 +1,12 @@
+// run-fail
+// compile-flags:--test
+// check-stdout
+
+mod m {
+    pub fn exported() {}
+
+    #[test]
+    fn unexported() {
+        panic!("ran an unexported test");
+    }
+}
diff --git a/src/test/ui/threads-sendsync/task-spawn-barefn.rs b/src/test/ui/threads-sendsync/task-spawn-barefn.rs
new file mode 100644
index 00000000000..e5b899e0af9
--- /dev/null
+++ b/src/test/ui/threads-sendsync/task-spawn-barefn.rs
@@ -0,0 +1,18 @@
+// run-fail
+// error-pattern:Ensure that the child thread runs by panicking
+// ignore-emscripten Needs threads.
+
+use std::thread;
+
+fn main() {
+    // the purpose of this test is to make sure that thread::spawn()
+    // works when provided with a bare function:
+    let r = thread::spawn(startfn).join();
+    if r.is_err() {
+        panic!()
+    }
+}
+
+fn startfn() {
+    assert!("Ensure that the child thread runs by panicking".is_empty());
+}
diff --git a/src/test/ui/threads-sendsync/test-tasks-invalid-value.rs b/src/test/ui/threads-sendsync/test-tasks-invalid-value.rs
new file mode 100644
index 00000000000..6411421429c
--- /dev/null
+++ b/src/test/ui/threads-sendsync/test-tasks-invalid-value.rs
@@ -0,0 +1,11 @@
+// This checks that RUST_TEST_THREADS not being 1, 2, ... is detected
+// properly.
+
+// run-fail
+// error-pattern:should be a positive integer
+// compile-flags: --test
+// exec-env:RUST_TEST_THREADS=foo
+// ignore-emscripten
+
+#[test]
+fn do_nothing() {}
diff --git a/src/test/ui/vec/vec-overrun.rs b/src/test/ui/vec/vec-overrun.rs
new file mode 100644
index 00000000000..4f6aec7773f
--- /dev/null
+++ b/src/test/ui/vec/vec-overrun.rs
@@ -0,0 +1,11 @@
+// run-fail
+// error-pattern:index out of bounds: the len is 1 but the index is 2
+
+fn main() {
+    let v: Vec<isize> = vec![10];
+    let x: usize = 0;
+    assert_eq!(v[x], 10);
+    // Bounds-check panic.
+
+    assert_eq!(v[x + 2], 20);
+}