diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 028623aa7aa9c..b0e06731330a1 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -359,7 +359,6 @@ impl<'a> Builder<'a> { test::Tidy, test::Ui, test::CompileFail, - test::RunFail, test::RunPassValgrind, test::MirOpt, test::Codegen, @@ -370,7 +369,6 @@ impl<'a> Builder<'a> { test::UiFullDeps, test::Rustdoc, test::Pretty, - test::RunFailPretty, test::RunPassValgrindPretty, test::Crate, test::CrateLibrustc, diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in index e0a1f46078d32..d8c97fc741478 100644 --- a/src/bootstrap/mk/Makefile.in +++ b/src/bootstrap/mk/Makefile.in @@ -48,7 +48,6 @@ check: $(Q)$(BOOTSTRAP) test $(BOOTSTRAP_ARGS) check-aux: $(Q)$(BOOTSTRAP) test \ - src/test/run-fail/pretty \ src/test/run-pass-valgrind/pretty \ $(AUX_ARGS) \ $(BOOTSTRAP_ARGS) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 0cf47d20ead06..ad3fd0d64a307 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -898,8 +898,6 @@ default_test!(CompileFail { suite: "compile-fail" }); -default_test!(RunFail { path: "src/test/run-fail", mode: "run-fail", suite: "run-fail" }); - default_test!(RunPassValgrind { path: "src/test/run-pass-valgrind", mode: "run-pass-valgrind", @@ -929,13 +927,6 @@ host_test!(UiFullDeps { path: "src/test/ui-fulldeps", mode: "ui", suite: "ui-ful host_test!(Rustdoc { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" }); host_test!(Pretty { path: "src/test/pretty", mode: "pretty", suite: "pretty" }); -test!(RunFailPretty { - path: "src/test/run-fail/pretty", - mode: "pretty", - suite: "run-fail", - default: false, - host: true -}); test!(RunPassValgrindPretty { path: "src/test/run-pass-valgrind/pretty", mode: "pretty", diff --git a/src/test/run-fail/bug-811.rs b/src/test/run-fail/bug-811.rs deleted file mode 100644 index e36ec0f59010b..0000000000000 --- a/src/test/run-fail/bug-811.rs +++ /dev/null @@ -1,24 +0,0 @@ -// error-pattern:quux - -use std::marker::PhantomData; - -fn test00_start(ch: chan_t, message: isize) { - send(ch, message); -} - -type task_id = isize; -type port_id = isize; - -struct chan_t { - task: task_id, - port: port_id, - marker: PhantomData<*mut T>, -} - -fn send(_ch: chan_t, _data: T) { - panic!(); -} - -fn main() { - panic!("quux"); -} diff --git a/src/test/run-fail/overflowing-lsh-1.rs b/src/test/run-fail/overflowing-lsh-1.rs deleted file mode 100644 index 977cfea0fe05d..0000000000000 --- a/src/test/run-fail/overflowing-lsh-1.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = 1_i32 << 32; -} diff --git a/src/test/run-fail/overflowing-lsh-2.rs b/src/test/run-fail/overflowing-lsh-2.rs deleted file mode 100644 index 3517dacde3aa3..0000000000000 --- a/src/test/run-fail/overflowing-lsh-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = 1 << -1; -} diff --git a/src/test/run-fail/overflowing-lsh-3.rs b/src/test/run-fail/overflowing-lsh-3.rs deleted file mode 100644 index 4a575c3fa7f6a..0000000000000 --- a/src/test/run-fail/overflowing-lsh-3.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = 1_u64 << 64; -} diff --git a/src/test/run-fail/overflowing-rsh-1.rs b/src/test/run-fail/overflowing-rsh-1.rs deleted file mode 100644 index 4592b2b6260bd..0000000000000 --- a/src/test/run-fail/overflowing-rsh-1.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = -1_i32 >> 32; -} diff --git a/src/test/run-fail/overflowing-rsh-2.rs b/src/test/run-fail/overflowing-rsh-2.rs deleted file mode 100644 index 066267b770db2..0000000000000 --- a/src/test/run-fail/overflowing-rsh-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = -1_i32 >> -1; -} diff --git a/src/test/run-fail/overflowing-rsh-3.rs b/src/test/run-fail/overflowing-rsh-3.rs deleted file mode 100644 index 67e78482866cb..0000000000000 --- a/src/test/run-fail/overflowing-rsh-3.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _x = -1_i64 >> 64; -} diff --git a/src/test/run-fail/overflowing-rsh-5.rs b/src/test/run-fail/overflowing-rsh-5.rs deleted file mode 100644 index 20ef324a82aeb..0000000000000 --- a/src/test/run-fail/overflowing-rsh-5.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] - -fn main() { - let _n = 1i64 >> [64][0]; -} diff --git a/src/test/run-fail/overflowing-rsh-6.rs b/src/test/run-fail/overflowing-rsh-6.rs deleted file mode 100644 index 589a98bab0401..0000000000000 --- a/src/test/run-fail/overflowing-rsh-6.rs +++ /dev/null @@ -1,10 +0,0 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' -// compile-flags: -C debug-assertions - -#![warn(arithmetic_overflow)] -#![warn(const_err)] -#![feature(const_indexing)] - -fn main() { - let _n = 1i64 >> [64][0]; -} diff --git a/src/test/run-fail/panic-macro-any.rs b/src/test/run-fail/panic-macro-any.rs deleted file mode 100644 index 72d42e5b799cd..0000000000000 --- a/src/test/run-fail/panic-macro-any.rs +++ /dev/null @@ -1,7 +0,0 @@ -// error-pattern:panicked at 'Box' - -#![feature(box_syntax)] - -fn main() { - panic!(box 413 as Box<::std::any::Any + Send>); -} diff --git a/src/test/run-fail/unwind-unique.rs b/src/test/run-fail/unwind-unique.rs deleted file mode 100644 index 7b761faad9534..0000000000000 --- a/src/test/run-fail/unwind-unique.rs +++ /dev/null @@ -1,10 +0,0 @@ -// error-pattern:fail - -fn failfn() { - panic!(); -} - -fn main() { - Box::new(0); - failfn(); -} diff --git a/src/test/run-fail/bounds-check-no-overflow.rs b/src/test/ui/array-slice-vec/bounds-check-no-overflow.rs similarity index 77% rename from src/test/run-fail/bounds-check-no-overflow.rs rename to src/test/ui/array-slice-vec/bounds-check-no-overflow.rs index 3943f87f7fe0c..3caf5f4499522 100644 --- a/src/test/run-fail/bounds-check-no-overflow.rs +++ b/src/test/ui/array-slice-vec/bounds-check-no-overflow.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds +// ignore-emscripten no processes use std::usize; use std::mem::size_of; diff --git a/src/test/run-fail/dst-raw-slice.rs b/src/test/ui/array-slice-vec/dst-raw-slice.rs similarity index 81% rename from src/test/run-fail/dst-raw-slice.rs rename to src/test/ui/array-slice-vec/dst-raw-slice.rs index 2575de7cc5833..371d16f093a74 100644 --- a/src/test/run-fail/dst-raw-slice.rs +++ b/src/test/ui/array-slice-vec/dst-raw-slice.rs @@ -1,5 +1,9 @@ // Test bounds checking for DST raw slices + +// run-fail // error-pattern:index out of bounds +// ignore-emscripten no processes + #[allow(unconditional_panic)] fn main() { let a: *const [_] = &[1, 2, 3]; diff --git a/src/test/run-fail/binop-fail-3.rs b/src/test/ui/binop/binop-fail-3.rs similarity index 74% rename from src/test/run-fail/binop-fail-3.rs rename to src/test/ui/binop/binop-fail-3.rs index a7696fffda0c2..49f635e0c11d6 100644 --- a/src/test/run-fail/binop-fail-3.rs +++ b/src/test/ui/binop/binop-fail-3.rs @@ -1,9 +1,11 @@ +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn foo() -> ! { panic!("quux"); } -#[allow(resolve_trait_on_defaulted_unit)] fn main() { foo() == foo(); // these types wind up being defaulted to () } diff --git a/src/test/run-fail/binop-panic.rs b/src/test/ui/binop/binop-panic.rs similarity index 75% rename from src/test/run-fail/binop-panic.rs rename to src/test/ui/binop/binop-panic.rs index dba5cecc67e11..44cdfffeeb7a7 100644 --- a/src/test/run-fail/binop-panic.rs +++ b/src/test/ui/binop/binop-panic.rs @@ -1,8 +1,12 @@ +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); } + fn main() { 3_usize == my_err("bye".to_string()); } diff --git a/src/test/run-fail/borrowck-local-borrow.rs b/src/test/ui/borrowck/borrowck-local-borrow.rs similarity index 77% rename from src/test/run-fail/borrowck-local-borrow.rs rename to src/test/ui/borrowck/borrowck-local-borrow.rs index d07f76b6252dc..ea4589338c46f 100644 --- a/src/test/run-fail/borrowck-local-borrow.rs +++ b/src/test/ui/borrowck/borrowck-local-borrow.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panic 1 +// ignore-emscripten no processes // revisions: migrate mir //[mir]compile-flags: -Z borrowck=mir diff --git a/src/test/run-fail/diverging-closure.rs b/src/test/ui/closures/diverging-closure.rs similarity index 69% rename from src/test/run-fail/diverging-closure.rs rename to src/test/ui/closures/diverging-closure.rs index a92e07a21fe4f..1213a883ef0a3 100644 --- a/src/test/run-fail/diverging-closure.rs +++ b/src/test/ui/closures/diverging-closure.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:oops +// ignore-emscripten no processes fn main() { let func = || -> ! { diff --git a/src/test/run-fail/promoted_div_by_zero.rs b/src/test/ui/consts/promoted_div_by_zero.rs similarity index 73% rename from src/test/run-fail/promoted_div_by_zero.rs rename to src/test/ui/consts/promoted_div_by_zero.rs index dc6719ce025f2..b4503f691ffd9 100644 --- a/src/test/run-fail/promoted_div_by_zero.rs +++ b/src/test/ui/consts/promoted_div_by_zero.rs @@ -1,6 +1,8 @@ #![allow(unconditional_panic, const_err)] +// run-fail // error-pattern: attempt to divide by zero +// ignore-emscripten no processes fn main() { let x = &(1 / (1 - 1)); diff --git a/src/test/run-fail/expr-fn-panic.rs b/src/test/ui/fn/expr-fn-panic.rs similarity index 65% rename from src/test/run-fail/expr-fn-panic.rs rename to src/test/ui/fn/expr-fn-panic.rs index 0532c32ec7028..123b57f97a4ec 100644 --- a/src/test/run-fail/expr-fn-panic.rs +++ b/src/test/ui/fn/expr-fn-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn f() -> ! { panic!() diff --git a/src/test/run-fail/generator-resume-after-panic.rs b/src/test/ui/generator/generator-resume-after-panic.rs similarity index 90% rename from src/test/run-fail/generator-resume-after-panic.rs rename to src/test/ui/generator/generator-resume-after-panic.rs index 1a7c2e8062901..55704f40e9f2b 100644 --- a/src/test/run-fail/generator-resume-after-panic.rs +++ b/src/test/ui/generator/generator-resume-after-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:generator resumed after panicking +// ignore-emscripten no processes // Test that we get the correct message for resuming a panicked generator. diff --git a/src/test/run-fail/hashmap-capacity-overflow.rs b/src/test/ui/hashmap/hashmap-capacity-overflow.rs similarity index 86% rename from src/test/run-fail/hashmap-capacity-overflow.rs rename to src/test/ui/hashmap/hashmap-capacity-overflow.rs index 038f2756ff322..5f88683f4adfc 100644 --- a/src/test/run-fail/hashmap-capacity-overflow.rs +++ b/src/test/ui/hashmap/hashmap-capacity-overflow.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:capacity overflow +// ignore-emscripten no processes use std::collections::hash_map::HashMap; use std::usize; diff --git a/src/test/ui/hashmap-iter-value-lifetime.nll.stderr b/src/test/ui/hashmap/hashmap-iter-value-lifetime.nll.stderr similarity index 100% rename from src/test/ui/hashmap-iter-value-lifetime.nll.stderr rename to 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 similarity index 100% rename from src/test/ui/hashmap-iter-value-lifetime.rs rename to 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 similarity index 100% rename from src/test/ui/hashmap-iter-value-lifetime.stderr rename to 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 similarity index 100% rename from src/test/ui/hashmap-lifetimes.nll.stderr rename to 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 similarity index 100% rename from src/test/ui/hashmap-lifetimes.rs rename to src/test/ui/hashmap/hashmap-lifetimes.rs diff --git a/src/test/ui/hashmap-lifetimes.stderr b/src/test/ui/hashmap/hashmap-lifetimes.stderr similarity index 100% rename from src/test/ui/hashmap-lifetimes.stderr rename to src/test/ui/hashmap/hashmap-lifetimes.stderr diff --git a/src/test/ui/hashmap-memory.rs b/src/test/ui/hashmap/hashmap-memory.rs similarity index 100% rename from src/test/ui/hashmap-memory.rs rename to src/test/ui/hashmap/hashmap-memory.rs diff --git a/src/test/run-fail/expr-if-panic-fn.rs b/src/test/ui/if/expr-if-panic-fn.rs similarity index 80% rename from src/test/run-fail/expr-if-panic-fn.rs rename to src/test/ui/if/expr-if-panic-fn.rs index 660b1396e38a9..36e49785a49d0 100644 --- a/src/test/run-fail/expr-if-panic-fn.rs +++ b/src/test/ui/if/expr-if-panic-fn.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn f() -> ! { panic!() diff --git a/src/test/run-fail/expr-if-panic.rs b/src/test/ui/if/expr-if-panic.rs similarity index 76% rename from src/test/run-fail/expr-if-panic.rs rename to src/test/ui/if/expr-if-panic.rs index 36aaf459a56ee..520ee0870ee15 100644 --- a/src/test/run-fail/expr-if-panic.rs +++ b/src/test/ui/if/expr-if-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn main() { let _x = if false { diff --git a/src/test/run-fail/if-check-panic.rs b/src/test/ui/if/if-check-panic.rs similarity index 87% rename from src/test/run-fail/if-check-panic.rs rename to src/test/ui/if/if-check-panic.rs index f9a4b8fcb38a5..037cd427ccf36 100644 --- a/src/test/run-fail/if-check-panic.rs +++ b/src/test/ui/if/if-check-panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:Number is odd +// ignore-emscripten no processes + fn even(x: usize) -> bool { if x < 2 { return false; diff --git a/src/test/run-fail/if-cond-bot.rs b/src/test/ui/if/if-cond-bot.rs similarity index 75% rename from src/test/run-fail/if-cond-bot.rs rename to src/test/ui/if/if-cond-bot.rs index c680cad258f24..bcd114678528c 100644 --- a/src/test/run-fail/if-cond-bot.rs +++ b/src/test/ui/if/if-cond-bot.rs @@ -1,8 +1,12 @@ +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); } + fn main() { if my_err("bye".to_string()) { } diff --git a/src/test/run-fail/glob-use-std.rs b/src/test/ui/imports/glob-use-std.rs similarity index 68% rename from src/test/run-fail/glob-use-std.rs rename to src/test/ui/imports/glob-use-std.rs index d19a782986b16..ef06cc570d557 100644 --- a/src/test/run-fail/glob-use-std.rs +++ b/src/test/ui/imports/glob-use-std.rs @@ -1,6 +1,8 @@ // Issue #7580 +// run-fail // error-pattern:panic works +// ignore-emscripten no processes use std::*; diff --git a/src/test/run-fail/issue-12920.rs b/src/test/ui/issues/issue-12920.rs similarity index 65% rename from src/test/run-fail/issue-12920.rs rename to src/test/ui/issues/issue-12920.rs index 0819e992d1378..a0cfea055be2b 100644 --- a/src/test/run-fail/issue-12920.rs +++ b/src/test/ui/issues/issue-12920.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes pub fn main() { panic!(); diff --git a/src/test/run-fail/issue-13202.rs b/src/test/ui/issues/issue-13202.rs similarity index 68% rename from src/test/run-fail/issue-13202.rs rename to src/test/ui/issues/issue-13202.rs index cf3a6b3d986f5..16debb5b6c4a6 100644 --- a/src/test/run-fail/issue-13202.rs +++ b/src/test/ui/issues/issue-13202.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:bad input +// ignore-emscripten no processes fn main() { Some("foo").unwrap_or(panic!("bad input")).to_string(); diff --git a/src/test/run-fail/issue-18576.rs b/src/test/ui/issues/issue-18576.rs similarity index 85% rename from src/test/run-fail/issue-18576.rs rename to src/test/ui/issues/issue-18576.rs index ca9d1e5f5e7de..389cf108b05ee 100644 --- a/src/test/run-fail/issue-18576.rs +++ b/src/test/ui/issues/issue-18576.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:stop +// ignore-emscripten no processes // #18576 // Make sure that calling an extern function pointer in an unreachable @@ -10,4 +12,5 @@ fn main() { let pointer = other; pointer(); } + extern "C" fn other() {} diff --git a/src/test/run-fail/issue-20971.rs b/src/test/ui/issues/issue-20971.rs similarity index 72% rename from src/test/run-fail/issue-20971.rs rename to src/test/ui/issues/issue-20971.rs index 6c2de783c0166..2e10418178c42 100644 --- a/src/test/run-fail/issue-20971.rs +++ b/src/test/ui/issues/issue-20971.rs @@ -1,6 +1,8 @@ // Regression test for Issue #20971. +// run-fail // error-pattern:Hello, world! +// ignore-emscripten no processes pub trait Parser { type Input; @@ -12,7 +14,7 @@ impl Parser for () { fn parse(&mut self, input: ()) {} } -pub fn many() -> Box::Input> + 'static> { +pub fn many() -> Box::Input> + 'static> { panic!("Hello, world!") } diff --git a/src/test/run-fail/issue-23354-2.rs b/src/test/ui/issues/issue-23354-2.rs similarity index 80% rename from src/test/run-fail/issue-23354-2.rs rename to src/test/ui/issues/issue-23354-2.rs index 8f7baff56dc55..c291d8a5eaf3d 100644 --- a/src/test/run-fail/issue-23354-2.rs +++ b/src/test/ui/issues/issue-23354-2.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panic evaluated +// ignore-emscripten no processes #[allow(unused_variables)] fn main() { diff --git a/src/test/run-fail/issue-23354.rs b/src/test/ui/issues/issue-23354.rs similarity index 72% rename from src/test/run-fail/issue-23354.rs rename to src/test/ui/issues/issue-23354.rs index 4c2fb022a6bf6..8b7c2eef2fc1b 100644 --- a/src/test/run-fail/issue-23354.rs +++ b/src/test/ui/issues/issue-23354.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panic evaluated +// ignore-emscripten no processes #[allow(unused_variables)] fn main() { diff --git a/src/test/run-fail/issue-2444.rs b/src/test/ui/issues/issue-2444.rs similarity index 51% rename from src/test/run-fail/issue-2444.rs rename to src/test/ui/issues/issue-2444.rs index 17f89e4d20d3e..ac0d0506a342d 100644 --- a/src/test/run-fail/issue-2444.rs +++ b/src/test/ui/issues/issue-2444.rs @@ -1,12 +1,14 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes use std::sync::Arc; -enum e { - ee(Arc), +enum Err { + Errr(Arc), } -fn foo() -> e { +fn foo() -> Err { panic!(); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow.rs b/src/test/ui/issues/issue-2470-bounds-check-overflow.rs similarity index 94% rename from src/test/run-fail/bug-2470-bounds-check-overflow.rs rename to src/test/ui/issues/issue-2470-bounds-check-overflow.rs index b4e3f24699118..f0e8e185e5633 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow.rs +++ b/src/test/ui/issues/issue-2470-bounds-check-overflow.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds +// ignore-emscripten no processes use std::mem; diff --git a/src/test/run-fail/issue-2761.rs b/src/test/ui/issues/issue-2761.rs similarity index 64% rename from src/test/run-fail/issue-2761.rs rename to src/test/ui/issues/issue-2761.rs index 84d90930d2d23..3ba098abbe65a 100644 --- a/src/test/run-fail/issue-2761.rs +++ b/src/test/ui/issues/issue-2761.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:custom message +// ignore-emscripten no processes fn main() { assert!(false, "custom message"); diff --git a/src/test/run-fail/issue-28934.rs b/src/test/ui/issues/issue-28934.rs similarity index 92% rename from src/test/run-fail/issue-28934.rs rename to src/test/ui/issues/issue-28934.rs index 5915372b6920f..1e48878f632e5 100644 --- a/src/test/run-fail/issue-28934.rs +++ b/src/test/ui/issues/issue-28934.rs @@ -1,7 +1,9 @@ // 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 +// ignore-emscripten no processes struct Parser<'i: 't, 't>(&'i u8, &'t u8); diff --git a/src/test/run-fail/issue-29798.rs b/src/test/ui/issues/issue-29798.rs similarity index 77% rename from src/test/run-fail/issue-29798.rs rename to src/test/ui/issues/issue-29798.rs index b06aa5fc728d9..5eff5d1915bad 100644 --- a/src/test/run-fail/issue-29798.rs +++ b/src/test/ui/issues/issue-29798.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 5 +// ignore-emscripten no processes const fn test(x: usize) -> i32 { [42;5][x] diff --git a/src/test/run-fail/issue-3029.rs b/src/test/ui/issues/issue-3029.rs similarity index 83% rename from src/test/run-fail/issue-3029.rs rename to src/test/ui/issues/issue-3029.rs index face808b68ff3..a5d30960a4cdb 100644 --- a/src/test/run-fail/issue-3029.rs +++ b/src/test/ui/issues/issue-3029.rs @@ -1,9 +1,11 @@ +// run-fail +// error-pattern:so long +// ignore-emscripten no processes + #![allow(unused_allocation)] #![allow(unreachable_code)] #![allow(unused_variables)] - -// error-pattern:so long fn main() { let mut x = Vec::new(); let y = vec![3]; diff --git a/src/test/run-fail/issue-30380.rs b/src/test/ui/issues/issue-30380.rs similarity index 94% rename from src/test/run-fail/issue-30380.rs rename to src/test/ui/issues/issue-30380.rs index 036071a89c7a4..48b329c5de148 100644 --- a/src/test/run-fail/issue-30380.rs +++ b/src/test/ui/issues/issue-30380.rs @@ -1,7 +1,9 @@ // 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! +// ignore-emscripten no processes struct Observer<'a>(&'a mut FilledOnDrop); diff --git a/src/test/run-fail/issue-44216-add-instant.rs b/src/test/ui/issues/issue-44216-add-instant.rs similarity index 78% rename from src/test/run-fail/issue-44216-add-instant.rs rename to src/test/ui/issues/issue-44216-add-instant.rs index 76ad0a3d41bf8..c2f3598f645bb 100644 --- a/src/test/run-fail/issue-44216-add-instant.rs +++ b/src/test/ui/issues/issue-44216-add-instant.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:overflow +// ignore-emscripten no processes use std::time::{Instant, Duration}; diff --git a/src/test/run-fail/issue-44216-add-system-time.rs b/src/test/ui/issues/issue-44216-add-system-time.rs similarity index 78% rename from src/test/run-fail/issue-44216-add-system-time.rs rename to src/test/ui/issues/issue-44216-add-system-time.rs index aa861f7d5993e..9a88cb7c18916 100644 --- a/src/test/run-fail/issue-44216-add-system-time.rs +++ b/src/test/ui/issues/issue-44216-add-system-time.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:overflow +// ignore-emscripten no processes use std::time::{Duration, SystemTime}; diff --git a/src/test/run-fail/issue-44216-sub-instant.rs b/src/test/ui/issues/issue-44216-sub-instant.rs similarity index 78% rename from src/test/run-fail/issue-44216-sub-instant.rs rename to src/test/ui/issues/issue-44216-sub-instant.rs index 8bc1f47ae2d96..2decd88bbc06b 100644 --- a/src/test/run-fail/issue-44216-sub-instant.rs +++ b/src/test/ui/issues/issue-44216-sub-instant.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:overflow +// ignore-emscripten no processes use std::time::{Instant, Duration}; diff --git a/src/test/run-fail/issue-44216-sub-system-time.rs b/src/test/ui/issues/issue-44216-sub-system-time.rs similarity index 78% rename from src/test/run-fail/issue-44216-sub-system-time.rs rename to src/test/ui/issues/issue-44216-sub-system-time.rs index 37ab0e7c3f99f..e58a31a41a5e9 100644 --- a/src/test/run-fail/issue-44216-sub-system-time.rs +++ b/src/test/ui/issues/issue-44216-sub-system-time.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:overflow +// ignore-emscripten no processes use std::time::{Duration, SystemTime}; diff --git a/src/test/run-fail/issue-51345.rs b/src/test/ui/issues/issue-51345-2.rs similarity index 75% rename from src/test/run-fail/issue-51345.rs rename to src/test/ui/issues/issue-51345-2.rs index c62f98ea78d1e..52f342a85005e 100644 --- a/src/test/run-fail/issue-51345.rs +++ b/src/test/ui/issues/issue-51345-2.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern: thread 'main' panicked at 'explicit panic' +// ignore-emscripten no processes fn main() { let mut vec = vec![]; diff --git a/src/test/run-fail/issue-6458-1.rs b/src/test/ui/issues/issue-6458-1.rs similarity index 64% rename from src/test/run-fail/issue-6458-1.rs rename to src/test/ui/issues/issue-6458-1.rs index 550bb2b832f44..184e4832b90b0 100644 --- a/src/test/run-fail/issue-6458-1.rs +++ b/src/test/ui/issues/issue-6458-1.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn foo(t: T) {} fn main() { diff --git a/src/test/ui/issues/issue-811.rs b/src/test/ui/issues/issue-811.rs new file mode 100644 index 0000000000000..f929d388819a9 --- /dev/null +++ b/src/test/ui/issues/issue-811.rs @@ -0,0 +1,26 @@ +// run-fail +// error-pattern:quux +// ignore-emscripten no processes + +use std::marker::PhantomData; + +fn test00_start(ch: Chan, message: isize) { + send(ch, message); +} + +type TaskId = isize; +type PortId = isize; + +struct Chan { + task: TaskId, + port: PortId, + marker: PhantomData<*mut T>, +} + +fn send(_ch: Chan, _data: T) { + panic!(); +} + +fn main() { + panic!("quux"); +} diff --git a/src/test/run-fail/issue-948.rs b/src/test/ui/issues/issue-948.rs similarity index 82% rename from src/test/run-fail/issue-948.rs rename to src/test/ui/issues/issue-948.rs index 8f1c6587f030a..b9bbeb3951e47 100644 --- a/src/test/run-fail/issue-948.rs +++ b/src/test/ui/issues/issue-948.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:beep boop +// ignore-emscripten no processes #![allow(unused_variables)] diff --git a/src/test/run-fail/for-each-loop-panic.rs b/src/test/ui/loops/for-each-loop-panic.rs similarity index 68% rename from src/test/run-fail/for-each-loop-panic.rs rename to src/test/ui/loops/for-each-loop-panic.rs index d24e81e152c3c..5156999f4db9c 100644 --- a/src/test/run-fail/for-each-loop-panic.rs +++ b/src/test/ui/loops/for-each-loop-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:moop +// ignore-emscripten no processes fn main() { for _ in 0_usize..10_usize { diff --git a/src/test/run-fail/assert-as-macro.rs b/src/test/ui/macros/assert-as-macro.rs similarity index 62% rename from src/test/run-fail/assert-as-macro.rs rename to src/test/ui/macros/assert-as-macro.rs index f715e21f781bd..23c0548081333 100644 --- a/src/test/run-fail/assert-as-macro.rs +++ b/src/test/ui/macros/assert-as-macro.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:assertion failed: 1 == 2 +// ignore-emscripten no processes fn main() { assert!(1 == 2); diff --git a/src/test/run-fail/assert-eq-macro-panic.rs b/src/test/ui/macros/assert-eq-macro-panic.rs similarity index 76% rename from src/test/run-fail/assert-eq-macro-panic.rs rename to src/test/ui/macros/assert-eq-macro-panic.rs index 863fec12d7475..5e505c30b3503 100644 --- a/src/test/run-fail/assert-eq-macro-panic.rs +++ b/src/test/ui/macros/assert-eq-macro-panic.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:assertion failed: `(left == right)` // error-pattern: left: `14` // error-pattern:right: `15` +// ignore-emscripten no processes fn main() { assert_eq!(14, 15); diff --git a/src/test/run-fail/assert-macro-explicit.rs b/src/test/ui/macros/assert-macro-explicit.rs similarity index 66% rename from src/test/run-fail/assert-macro-explicit.rs rename to src/test/ui/macros/assert-macro-explicit.rs index 3689323c999d6..578ef5632780f 100644 --- a/src/test/run-fail/assert-macro-explicit.rs +++ b/src/test/ui/macros/assert-macro-explicit.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'assertion failed: false' +// ignore-emscripten no processes fn main() { assert!(false); diff --git a/src/test/run-fail/assert-macro-fmt.rs b/src/test/ui/macros/assert-macro-fmt.rs similarity index 73% rename from src/test/run-fail/assert-macro-fmt.rs rename to src/test/ui/macros/assert-macro-fmt.rs index 9fbfb085c2fa5..b8d319d85f404 100644 --- a/src/test/run-fail/assert-macro-fmt.rs +++ b/src/test/ui/macros/assert-macro-fmt.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-assert-fmt 42 rust' +// ignore-emscripten no processes fn main() { assert!(false, "test-assert-fmt {} {}", 42, "rust"); diff --git a/src/test/run-fail/assert-macro-owned.rs b/src/test/ui/macros/assert-macro-owned.rs similarity index 71% rename from src/test/run-fail/assert-macro-owned.rs rename to src/test/ui/macros/assert-macro-owned.rs index bd58d35eb719f..b50fe65c0150f 100644 --- a/src/test/run-fail/assert-macro-owned.rs +++ b/src/test/ui/macros/assert-macro-owned.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-assert-owned' +// ignore-emscripten no processes fn main() { assert!(false, "test-assert-owned".to_string()); diff --git a/src/test/run-fail/assert-macro-static.rs b/src/test/ui/macros/assert-macro-static.rs similarity index 69% rename from src/test/run-fail/assert-macro-static.rs rename to src/test/ui/macros/assert-macro-static.rs index 650aaeab4f66f..dc5274a7e8880 100644 --- a/src/test/run-fail/assert-macro-static.rs +++ b/src/test/ui/macros/assert-macro-static.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-assert-static' +// ignore-emscripten no processes fn main() { assert!(false, "test-assert-static"); diff --git a/src/test/run-fail/assert-ne-macro-panic.rs b/src/test/ui/macros/assert-ne-macro-panic.rs similarity index 76% rename from src/test/run-fail/assert-ne-macro-panic.rs rename to src/test/ui/macros/assert-ne-macro-panic.rs index f55ef2b3ff5ca..4f507d7b54d99 100644 --- a/src/test/run-fail/assert-ne-macro-panic.rs +++ b/src/test/ui/macros/assert-ne-macro-panic.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:assertion failed: `(left != right)` // error-pattern: left: `14` // error-pattern:right: `14` +// ignore-emscripten no processes fn main() { assert_ne!(14, 14); diff --git a/src/test/run-fail/die-macro.rs b/src/test/ui/macros/die-macro-2.rs similarity index 55% rename from src/test/run-fail/die-macro.rs rename to src/test/ui/macros/die-macro-2.rs index 846b9ea24d3b7..ebbce528a18fa 100644 --- a/src/test/run-fail/die-macro.rs +++ b/src/test/ui/macros/die-macro-2.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:test +// ignore-emscripten no processes fn main() { panic!("test"); diff --git a/src/test/run-fail/die-macro-expr.rs b/src/test/ui/macros/die-macro-expr.rs similarity index 62% rename from src/test/run-fail/die-macro-expr.rs rename to src/test/ui/macros/die-macro-expr.rs index 70413f978969c..c4b5f68ddf9ff 100644 --- a/src/test/run-fail/die-macro-expr.rs +++ b/src/test/ui/macros/die-macro-expr.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:test +// ignore-emscripten no processes fn main() { let __isize: isize = panic!("test"); diff --git a/src/test/run-fail/die-macro-pure.rs b/src/test/ui/macros/die-macro-pure.rs similarity index 62% rename from src/test/run-fail/die-macro-pure.rs rename to src/test/ui/macros/die-macro-pure.rs index cec0742d5035b..588fbe61b0e76 100644 --- a/src/test/run-fail/die-macro-pure.rs +++ b/src/test/ui/macros/die-macro-pure.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:test +// ignore-emscripten no processes fn f() { panic!("test"); diff --git a/src/test/run-fail/unimplemented-macro-panic.rs b/src/test/ui/macros/unimplemented-macro-panic.rs similarity index 59% rename from src/test/run-fail/unimplemented-macro-panic.rs rename to src/test/ui/macros/unimplemented-macro-panic.rs index 4d9cb740fc609..e7169903f8ea5 100644 --- a/src/test/run-fail/unimplemented-macro-panic.rs +++ b/src/test/ui/macros/unimplemented-macro-panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:not implemented +// ignore-emscripten no processes + fn main() { unimplemented!() } diff --git a/src/test/run-fail/unreachable-fmt-msg.rs b/src/test/ui/macros/unreachable-fmt-msg.rs similarity index 74% rename from src/test/run-fail/unreachable-fmt-msg.rs rename to src/test/ui/macros/unreachable-fmt-msg.rs index ac2a52163b4de..eb17ed92711c9 100644 --- a/src/test/run-fail/unreachable-fmt-msg.rs +++ b/src/test/ui/macros/unreachable-fmt-msg.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:internal error: entered unreachable code: 6 is not prime +// ignore-emscripten no processes + fn main() { unreachable!("{} is not {}", 6u32, "prime"); } diff --git a/src/test/run-fail/unreachable-macro-panic.rs b/src/test/ui/macros/unreachable-macro-panic.rs similarity index 65% rename from src/test/run-fail/unreachable-macro-panic.rs rename to src/test/ui/macros/unreachable-macro-panic.rs index 597a01447228d..55e2102e2cc6f 100644 --- a/src/test/run-fail/unreachable-macro-panic.rs +++ b/src/test/ui/macros/unreachable-macro-panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:internal error: entered unreachable code +// ignore-emscripten no processes + fn main() { unreachable!() } diff --git a/src/test/run-fail/unreachable-static-msg.rs b/src/test/ui/macros/unreachable-static-msg.rs similarity index 68% rename from src/test/run-fail/unreachable-static-msg.rs rename to src/test/ui/macros/unreachable-static-msg.rs index 40a2881cc5714..55edf3af7d9e5 100644 --- a/src/test/run-fail/unreachable-static-msg.rs +++ b/src/test/ui/macros/unreachable-static-msg.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:internal error: entered unreachable code: uhoh +// ignore-emscripten no processes + fn main() { unreachable!("uhoh") } diff --git a/src/test/run-fail/unreachable.rs b/src/test/ui/macros/unreachable.rs similarity index 65% rename from src/test/run-fail/unreachable.rs rename to src/test/ui/macros/unreachable.rs index 597a01447228d..55e2102e2cc6f 100644 --- a/src/test/run-fail/unreachable.rs +++ b/src/test/ui/macros/unreachable.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:internal error: entered unreachable code +// ignore-emscripten no processes + fn main() { unreachable!() } diff --git a/src/test/run-fail/expr-match-panic-fn.rs b/src/test/ui/match/expr-match-panic-fn.rs similarity index 80% rename from src/test/run-fail/expr-match-panic-fn.rs rename to src/test/ui/match/expr-match-panic-fn.rs index 120df61b4bfe6..ea471717e883a 100644 --- a/src/test/run-fail/expr-match-panic-fn.rs +++ b/src/test/ui/match/expr-match-panic-fn.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn f() -> ! { panic!() diff --git a/src/test/run-fail/expr-match-panic.rs b/src/test/ui/match/expr-match-panic.rs similarity index 73% rename from src/test/run-fail/expr-match-panic.rs rename to src/test/ui/match/expr-match-panic.rs index b2f0179a08323..53f8a8bd30ddb 100644 --- a/src/test/run-fail/expr-match-panic.rs +++ b/src/test/ui/match/expr-match-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes fn main() { let _x = match true { diff --git a/src/test/run-fail/match-bot-panic.rs b/src/test/ui/match/match-bot-panic.rs similarity index 84% rename from src/test/run-fail/match-bot-panic.rs rename to src/test/ui/match/match-bot-panic.rs index f4da8c4e43fb6..e4a6f6d6fe44a 100644 --- a/src/test/run-fail/match-bot-panic.rs +++ b/src/test/ui/match/match-bot-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:explicit panic +// ignore-emscripten no processes #![allow(unreachable_code)] #![allow(unused_variables)] diff --git a/src/test/run-fail/match-disc-bot.rs b/src/test/ui/match/match-disc-bot.rs similarity index 77% rename from src/test/run-fail/match-disc-bot.rs rename to src/test/ui/match/match-disc-bot.rs index a9312fbb1fb35..18cfd5e23950b 100644 --- a/src/test/run-fail/match-disc-bot.rs +++ b/src/test/ui/match/match-disc-bot.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn f() -> ! { panic!("quux") } diff --git a/src/test/run-fail/match-wildcards.rs b/src/test/ui/match/match-wildcards.rs similarity index 87% rename from src/test/run-fail/match-wildcards.rs rename to src/test/ui/match/match-wildcards.rs index 7a65ad5255896..43f6e4913ac76 100644 --- a/src/test/run-fail/match-wildcards.rs +++ b/src/test/ui/match/match-wildcards.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:squirrelcupcake +// ignore-emscripten no processes + fn cmp() -> isize { match (Some('a'), None::) { (Some(_), _) => { diff --git a/src/test/run-fail/meta-revision-bad.rs b/src/test/ui/meta-revision-bad.rs similarity index 96% rename from src/test/run-fail/meta-revision-bad.rs rename to src/test/ui/meta-revision-bad.rs index 17f6398b73554..01f1518c1c6ed 100644 --- a/src/test/run-fail/meta-revision-bad.rs +++ b/src/test/ui/meta-revision-bad.rs @@ -1,6 +1,7 @@ // 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 diff --git a/src/test/run-fail/meta-revision-ok.rs b/src/test/ui/meta-revision-ok.rs similarity index 87% rename from src/test/run-fail/meta-revision-ok.rs rename to src/test/ui/meta-revision-ok.rs index 8693ee5f4ef96..7df9a6ea48fae 100644 --- a/src/test/run-fail/meta-revision-ok.rs +++ b/src/test/ui/meta-revision-ok.rs @@ -1,9 +1,11 @@ // 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 +// ignore-emscripten no processes #[cfg(foo)] fn die() { diff --git a/src/test/run-fail/mir_codegen_calls_converging_drops.rs b/src/test/ui/mir/mir_codegen_calls_converging_drops.rs similarity index 89% rename from src/test/run-fail/mir_codegen_calls_converging_drops.rs rename to src/test/ui/mir/mir_codegen_calls_converging_drops.rs index ee0dc98ce6819..b562f93081419 100644 --- a/src/test/run-fail/mir_codegen_calls_converging_drops.rs +++ b/src/test/ui/mir/mir_codegen_calls_converging_drops.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:converging_fn called // error-pattern:0 dropped // error-pattern:exit +// ignore-emscripten no processes struct Droppable(u8); impl Drop for Droppable { diff --git a/src/test/run-fail/mir_codegen_calls_converging_drops_2.rs b/src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs similarity index 90% rename from src/test/run-fail/mir_codegen_calls_converging_drops_2.rs rename to src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs index ee2c25ce8565e..e9446da9e3911 100644 --- a/src/test/run-fail/mir_codegen_calls_converging_drops_2.rs +++ b/src/test/ui/mir/mir_codegen_calls_converging_drops_2.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:complex called // error-pattern:dropped // error-pattern:exit +// ignore-emscripten no processes struct Droppable; impl Drop for Droppable { diff --git a/src/test/run-fail/mir_codegen_calls_diverging.rs b/src/test/ui/mir/mir_codegen_calls_diverging.rs similarity index 77% rename from src/test/run-fail/mir_codegen_calls_diverging.rs rename to src/test/ui/mir/mir_codegen_calls_diverging.rs index dceae0a4e4a03..736d580e2da18 100644 --- a/src/test/run-fail/mir_codegen_calls_diverging.rs +++ b/src/test/ui/mir/mir_codegen_calls_diverging.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:diverging_fn called +// ignore-emscripten no processes fn diverging_fn() -> ! { panic!("diverging_fn called") diff --git a/src/test/run-fail/mir_codegen_calls_diverging_drops.rs b/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs similarity index 88% rename from src/test/run-fail/mir_codegen_calls_diverging_drops.rs rename to src/test/ui/mir/mir_codegen_calls_diverging_drops.rs index 187e526f7c092..796d744779391 100644 --- a/src/test/run-fail/mir_codegen_calls_diverging_drops.rs +++ b/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:diverging_fn called // error-pattern:0 dropped +// ignore-emscripten no processes struct Droppable(u8); impl Drop for Droppable { diff --git a/src/test/run-fail/mir_drop_panics.rs b/src/test/ui/mir/mir_drop_panics.rs similarity index 88% rename from src/test/run-fail/mir_drop_panics.rs rename to src/test/ui/mir/mir_drop_panics.rs index bda555b926288..bf269ee901b93 100644 --- a/src/test/run-fail/mir_drop_panics.rs +++ b/src/test/ui/mir/mir_drop_panics.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:panic 1 // error-pattern:drop 2 +// ignore-emscripten no processes struct Droppable(u32); impl Drop for Droppable { diff --git a/src/test/run-fail/mir_dynamic_drops_1.rs b/src/test/ui/mir/mir_dynamic_drops_1.rs similarity index 93% rename from src/test/run-fail/mir_dynamic_drops_1.rs rename to src/test/ui/mir/mir_dynamic_drops_1.rs index db8d0af29db2c..a77b2368d3baa 100644 --- a/src/test/run-fail/mir_dynamic_drops_1.rs +++ b/src/test/ui/mir/mir_dynamic_drops_1.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:drop 1 // error-pattern:drop 2 // ignore-cloudabi no std::process +// ignore-emscripten no processes /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/src/test/run-fail/mir_dynamic_drops_2.rs b/src/test/ui/mir/mir_dynamic_drops_2.rs similarity index 92% rename from src/test/run-fail/mir_dynamic_drops_2.rs rename to src/test/ui/mir/mir_dynamic_drops_2.rs index 21d3a042b1e31..088a16d338787 100644 --- a/src/test/run-fail/mir_dynamic_drops_2.rs +++ b/src/test/ui/mir/mir_dynamic_drops_2.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:drop 1 // ignore-cloudabi no std::process +// ignore-emscripten no processes /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/src/test/run-fail/mir_dynamic_drops_3.rs b/src/test/ui/mir/mir_dynamic_drops_3.rs similarity index 94% rename from src/test/run-fail/mir_dynamic_drops_3.rs rename to src/test/ui/mir/mir_dynamic_drops_3.rs index b90499686823a..029bdcd9a1590 100644 --- a/src/test/run-fail/mir_dynamic_drops_3.rs +++ b/src/test/ui/mir/mir_dynamic_drops_3.rs @@ -1,8 +1,10 @@ +// run-fail // error-pattern:unwind happens // error-pattern:drop 3 // error-pattern:drop 2 // error-pattern:drop 1 // ignore-cloudabi no std::process +// ignore-emscripten no processes /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/src/test/run-fail/mir_indexing_oob_1.rs b/src/test/ui/mir/mir_indexing_oob_1.rs similarity index 80% rename from src/test/run-fail/mir_indexing_oob_1.rs rename to src/test/ui/mir/mir_indexing_oob_1.rs index 1cd53e309ebf9..6d769b6b23a84 100644 --- a/src/test/run-fail/mir_indexing_oob_1.rs +++ b/src/test/ui/mir/mir_indexing_oob_1.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 10 +// ignore-emscripten no processes const C: [u32; 5] = [0; 5]; diff --git a/src/test/run-fail/mir_indexing_oob_2.rs b/src/test/ui/mir/mir_indexing_oob_2.rs similarity index 81% rename from src/test/run-fail/mir_indexing_oob_2.rs rename to src/test/ui/mir/mir_indexing_oob_2.rs index 64b260993c994..a9e8505701536 100644 --- a/src/test/run-fail/mir_indexing_oob_2.rs +++ b/src/test/ui/mir/mir_indexing_oob_2.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 10 +// ignore-emscripten no processes const C: &'static [u8; 5] = b"hello"; diff --git a/src/test/run-fail/mir_indexing_oob_3.rs b/src/test/ui/mir/mir_indexing_oob_3.rs similarity index 80% rename from src/test/run-fail/mir_indexing_oob_3.rs rename to src/test/ui/mir/mir_indexing_oob_3.rs index 3688088439bbf..4f5cab59bfc67 100644 --- a/src/test/run-fail/mir_indexing_oob_3.rs +++ b/src/test/ui/mir/mir_indexing_oob_3.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 10 +// ignore-emscripten no processes const C: &'static [u8; 5] = b"hello"; diff --git a/src/test/run-fail/return-never-coerce.rs b/src/test/ui/never_type/return-never-coerce.rs similarity index 84% rename from src/test/run-fail/return-never-coerce.rs rename to src/test/ui/never_type/return-never-coerce.rs index 18182ff0f9d47..d615940eff1f0 100644 --- a/src/test/run-fail/return-never-coerce.rs +++ b/src/test/ui/never_type/return-never-coerce.rs @@ -1,6 +1,8 @@ // Test that ! coerces to other types. +// run-fail // error-pattern:aah! +// ignore-emscripten no processes fn call_another_fn T>(f: F) -> T { f() diff --git a/src/test/run-fail/divide-by-zero.rs b/src/test/ui/numbers-arithmetic/divide-by-zero.rs similarity index 72% rename from src/test/run-fail/divide-by-zero.rs rename to src/test/ui/numbers-arithmetic/divide-by-zero.rs index ba93563154a3b..30e0e6c1bdd4c 100644 --- a/src/test/run-fail/divide-by-zero.rs +++ b/src/test/ui/numbers-arithmetic/divide-by-zero.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:attempt to divide by zero +// ignore-emscripten no processes + #[allow(unconditional_panic)] fn main() { let y = 0; diff --git a/src/test/run-fail/mod-zero.rs b/src/test/ui/numbers-arithmetic/mod-zero.rs similarity index 76% rename from src/test/run-fail/mod-zero.rs rename to src/test/ui/numbers-arithmetic/mod-zero.rs index f70b3ac920c61..083716394124a 100644 --- a/src/test/run-fail/mod-zero.rs +++ b/src/test/ui/numbers-arithmetic/mod-zero.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:attempt to calculate the remainder with a divisor of zero +// ignore-emscripten no processes + #[allow(unconditional_panic)] fn main() { let y = 0; diff --git a/src/test/run-fail/overflowing-add.rs b/src/test/ui/numbers-arithmetic/overflowing-add.rs similarity index 80% rename from src/test/run-fail/overflowing-add.rs rename to src/test/ui/numbers-arithmetic/overflowing-add.rs index 5ca91314d95a2..b0f22a74b4a8f 100644 --- a/src/test/run-fail/overflowing-add.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-add.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to add with overflow' // compile-flags: -C debug-assertions +// ignore-emscripten no processes #![allow(arithmetic_overflow)] 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 0000000000000..e5ce80336397d --- /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 0000000000000..54008d33968bc --- /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 0000000000000..7fd3407a056ef --- /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 0000000000000..872e71bb73796 --- /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 0000000000000..e007eb4a2e2f7 --- /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 0000000000000..d55ed4a046c9d --- /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/run-fail/overflowing-lsh-4.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs similarity index 85% rename from src/test/run-fail/overflowing-lsh-4.rs rename to src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs index 0d3912ce13f81..738d013391579 100644 --- a/src/test/run-fail/overflowing-lsh-4.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs @@ -1,15 +1,15 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow' +// build-fail // compile-flags: -C debug-assertions // This function is checking that our automatic truncation does not // sidestep the overflow checking. -#![warn(arithmetic_overflow)] -#![warn(const_err)] +#![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* 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 0000000000000..1ef8dd3466c0a --- /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/run-fail/overflowing-mul.rs b/src/test/ui/numbers-arithmetic/overflowing-mul.rs similarity index 80% rename from src/test/run-fail/overflowing-mul.rs rename to src/test/ui/numbers-arithmetic/overflowing-mul.rs index 2dfc9bb5ae472..34ab5d8fad5e6 100644 --- a/src/test/run-fail/overflowing-mul.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-mul.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/src/test/run-fail/overflowing-neg.rs b/src/test/ui/numbers-arithmetic/overflowing-neg.rs similarity index 80% rename from src/test/run-fail/overflowing-neg.rs rename to src/test/ui/numbers-arithmetic/overflowing-neg.rs index f512aa35beda6..fe77544641cc1 100644 --- a/src/test/run-fail/overflowing-neg.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-neg.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to negate with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/src/test/run-fail/overflowing-pow-signed.rs b/src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs similarity index 77% rename from src/test/run-fail/overflowing-pow-signed.rs rename to src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs index c539c685faf9e..b59efe6f21278 100644 --- a/src/test/run-fail/overflowing-pow-signed.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-pow-signed.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions fn main() { diff --git a/src/test/run-fail/overflowing-pow-unsigned.rs b/src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs similarity index 77% rename from src/test/run-fail/overflowing-pow-unsigned.rs rename to src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs index 1d4fa3b5c7eb8..f2643c1646316 100644 --- a/src/test/run-fail/overflowing-pow-unsigned.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-pow-unsigned.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions fn main() { 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 0000000000000..f1488cf8559a2 --- /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 0000000000000..236303e2e9aa3 --- /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 0000000000000..39127b9703b6b --- /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 0000000000000..981c8986f76b9 --- /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 0000000000000..8ee6dde93eafe --- /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 0000000000000..c2994503f0efc --- /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/run-fail/overflowing-rsh-4.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs similarity index 85% rename from src/test/run-fail/overflowing-rsh-4.rs rename to src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs index 1877d5c968526..ce7f818e330b9 100644 --- a/src/test/run-fail/overflowing-rsh-4.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs @@ -1,15 +1,15 @@ -// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow' +// build-fail // compile-flags: -C debug-assertions // This function is checking that our (type-based) automatic // truncation does not sidestep the overflow checking. -#![warn(arithmetic_overflow)] -#![warn(const_err)] +#![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* 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 0000000000000..3db1da06dbed8 --- /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 0000000000000..88928c9959666 --- /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 0000000000000..bd3eae82977e3 --- /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 0000000000000..88928c9959666 --- /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 0000000000000..5d76639fb50f3 --- /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/run-fail/overflowing-sub.rs b/src/test/ui/numbers-arithmetic/overflowing-sub.rs similarity index 80% rename from src/test/run-fail/overflowing-sub.rs rename to src/test/ui/numbers-arithmetic/overflowing-sub.rs index fb096c31957ee..66685ac961a17 100644 --- a/src/test/run-fail/overflowing-sub.rs +++ b/src/test/ui/numbers-arithmetic/overflowing-sub.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'attempt to subtract with overflow' +// ignore-emscripten no processes // compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/src/test/run-fail/promoted_overflow.rs b/src/test/ui/numbers-arithmetic/promoted_overflow.rs similarity index 92% rename from src/test/run-fail/promoted_overflow.rs rename to src/test/ui/numbers-arithmetic/promoted_overflow.rs index 3c42da4b1d8ed..da59e81ed6bf7 100644 --- a/src/test/run-fail/promoted_overflow.rs +++ b/src/test/ui/numbers-arithmetic/promoted_overflow.rs @@ -1,5 +1,6 @@ #![allow(arithmetic_overflow)] +// run-fail // error-pattern: overflow // compile-flags: -C overflow-checks=yes diff --git a/src/test/run-fail/unwind-interleaved.rs b/src/test/ui/panic-runtime/unwind-interleaved.rs similarity index 59% rename from src/test/run-fail/unwind-interleaved.rs rename to src/test/ui/panic-runtime/unwind-interleaved.rs index c163678ae9873..a8b3f3493097c 100644 --- a/src/test/run-fail/unwind-interleaved.rs +++ b/src/test/ui/panic-runtime/unwind-interleaved.rs @@ -1,4 +1,6 @@ -// error-pattern:fail +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes fn a() {} diff --git a/src/test/run-fail/unwind-rec.rs b/src/test/ui/panic-runtime/unwind-rec.rs similarity index 63% rename from src/test/run-fail/unwind-rec.rs rename to src/test/ui/panic-runtime/unwind-rec.rs index 83ac19ff4a533..a9b7ee8ec7d4a 100644 --- a/src/test/run-fail/unwind-rec.rs +++ b/src/test/ui/panic-runtime/unwind-rec.rs @@ -1,5 +1,6 @@ -// error-pattern:fail - +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes fn build() -> Vec { panic!(); diff --git a/src/test/run-fail/unwind-rec2.rs b/src/test/ui/panic-runtime/unwind-rec2.rs similarity index 76% rename from src/test/run-fail/unwind-rec2.rs rename to src/test/ui/panic-runtime/unwind-rec2.rs index 4dfc282b6c0f5..a130f9e879f2d 100644 --- a/src/test/run-fail/unwind-rec2.rs +++ b/src/test/ui/panic-runtime/unwind-rec2.rs @@ -1,5 +1,6 @@ -// error-pattern:fail - +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes fn build1() -> Vec { vec![0, 0, 0, 0, 0, 0, 0] 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 0000000000000..d66e39110eaca --- /dev/null +++ b/src/test/ui/panic-runtime/unwind-unique.rs @@ -0,0 +1,12 @@ +// run-fail +// error-pattern:explicit panic +// ignore-emscripten no processes + +fn failfn() { + panic!(); +} + +fn main() { + Box::new(0); + failfn(); +} diff --git a/src/test/run-fail/args-panic.rs b/src/test/ui/panics/args-panic.rs similarity index 78% rename from src/test/run-fail/args-panic.rs rename to src/test/ui/panics/args-panic.rs index 9a62652dde1e1..322054caf1161 100644 --- a/src/test/run-fail/args-panic.rs +++ b/src/test/ui/panics/args-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:meep +// ignore-emscripten no processes #![feature(box_syntax)] diff --git a/src/test/run-fail/doublepanic.rs b/src/test/ui/panics/doublepanic.rs similarity index 68% rename from src/test/run-fail/doublepanic.rs rename to src/test/ui/panics/doublepanic.rs index 10d303e491e44..c1fcc875c3613 100644 --- a/src/test/run-fail/doublepanic.rs +++ b/src/test/ui/panics/doublepanic.rs @@ -1,6 +1,9 @@ #![allow(unreachable_code)] +// run-fail // error-pattern:One +// ignore-emscripten no processes + fn main() { panic!("One"); panic!("Two"); diff --git a/src/test/run-fail/explicit-panic-msg.rs b/src/test/ui/panics/explicit-panic-msg.rs similarity index 80% rename from src/test/run-fail/explicit-panic-msg.rs rename to src/test/ui/panics/explicit-panic-msg.rs index 35e0518b9be57..1789e2e62c8b2 100644 --- a/src/test/run-fail/explicit-panic-msg.rs +++ b/src/test/ui/panics/explicit-panic-msg.rs @@ -1,7 +1,10 @@ #![allow(unused_assignments)] #![allow(unused_variables)] +// run-fail // error-pattern:wooooo +// ignore-emscripten no processes + fn main() { let mut a = 1; if 1 == 1 { diff --git a/src/test/run-fail/explicit-panic.rs b/src/test/ui/panics/explicit-panic.rs similarity index 53% rename from src/test/run-fail/explicit-panic.rs rename to src/test/ui/panics/explicit-panic.rs index 11ea6b4122128..27c73d3493cb8 100644 --- a/src/test/run-fail/explicit-panic.rs +++ b/src/test/ui/panics/explicit-panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:explicit +// ignore-emscripten no processes + fn main() { panic!(); } diff --git a/src/test/run-fail/fmt-panic.rs b/src/test/ui/panics/fmt-panic.rs similarity index 70% rename from src/test/run-fail/fmt-panic.rs rename to src/test/ui/panics/fmt-panic.rs index 5749991914c02..87fb2e6dd54b9 100644 --- a/src/test/run-fail/fmt-panic.rs +++ b/src/test/ui/panics/fmt-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:meh +// ignore-emscripten no processes fn main() { let str_var: String = "meh".to_string(); diff --git a/src/test/run-fail/main-panic.rs b/src/test/ui/panics/main-panic.rs similarity index 60% rename from src/test/run-fail/main-panic.rs rename to src/test/ui/panics/main-panic.rs index 3a9409562db6a..023ab47012596 100644 --- a/src/test/run-fail/main-panic.rs +++ b/src/test/ui/panics/main-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at +// ignore-emscripten no processes fn main() { panic!() diff --git a/src/test/run-fail/panic-arg.rs b/src/test/ui/panics/panic-arg.rs similarity index 68% rename from src/test/run-fail/panic-arg.rs rename to src/test/ui/panics/panic-arg.rs index c164ff94630b1..f7c2dbb096f29 100644 --- a/src/test/run-fail/panic-arg.rs +++ b/src/test/ui/panics/panic-arg.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:woe +// ignore-emscripten no processes + fn f(a: isize) { println!("{}", a); } diff --git a/src/test/run-fail/panic-macro-any-wrapped.rs b/src/test/ui/panics/panic-macro-any-wrapped.rs similarity index 65% rename from src/test/run-fail/panic-macro-any-wrapped.rs rename to src/test/ui/panics/panic-macro-any-wrapped.rs index 83eb39a538f16..80c87c6f32c4b 100644 --- a/src/test/run-fail/panic-macro-any-wrapped.rs +++ b/src/test/ui/panics/panic-macro-any-wrapped.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'Box' +// ignore-emscripten no processes 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 0000000000000..ffc7114c1f5f2 --- /dev/null +++ b/src/test/ui/panics/panic-macro-any.rs @@ -0,0 +1,9 @@ +// run-fail +// error-pattern:panicked at 'Box' +// ignore-emscripten no processes + +#![feature(box_syntax)] + +fn main() { + panic!(box 413 as Box); +} diff --git a/src/test/run-fail/panic-macro-explicit.rs b/src/test/ui/panics/panic-macro-explicit.rs similarity index 61% rename from src/test/run-fail/panic-macro-explicit.rs rename to src/test/ui/panics/panic-macro-explicit.rs index f632034807cd4..ac4d6f8128b87 100644 --- a/src/test/run-fail/panic-macro-explicit.rs +++ b/src/test/ui/panics/panic-macro-explicit.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'explicit panic' +// ignore-emscripten no processes fn main() { panic!(); diff --git a/src/test/run-fail/panic-macro-fmt.rs b/src/test/ui/panics/panic-macro-fmt.rs similarity index 71% rename from src/test/run-fail/panic-macro-fmt.rs rename to src/test/ui/panics/panic-macro-fmt.rs index 658ae56e7e49f..a755ebc0f4e3a 100644 --- a/src/test/run-fail/panic-macro-fmt.rs +++ b/src/test/ui/panics/panic-macro-fmt.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-fail-fmt 42 rust' +// ignore-emscripten no processes fn main() { panic!("test-fail-fmt {} {}", 42, "rust"); diff --git a/src/test/run-fail/panic-macro-owned.rs b/src/test/ui/panics/panic-macro-owned.rs similarity index 66% rename from src/test/run-fail/panic-macro-owned.rs rename to src/test/ui/panics/panic-macro-owned.rs index 9b935717638bc..b898fde77a3b6 100644 --- a/src/test/run-fail/panic-macro-owned.rs +++ b/src/test/ui/panics/panic-macro-owned.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-fail-owned' +// ignore-emscripten no processes fn main() { panic!("test-fail-owned"); diff --git a/src/test/run-fail/panic-macro-static.rs b/src/test/ui/panics/panic-macro-static.rs similarity index 67% rename from src/test/run-fail/panic-macro-static.rs rename to src/test/ui/panics/panic-macro-static.rs index 31ac488beb234..a1d467cbfb524 100644 --- a/src/test/run-fail/panic-macro-static.rs +++ b/src/test/ui/panics/panic-macro-static.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:panicked at 'test-fail-static' +// ignore-emscripten no processes fn main() { panic!("test-fail-static"); diff --git a/src/test/run-fail/panic-main.rs b/src/test/ui/panics/panic-main.rs similarity index 54% rename from src/test/run-fail/panic-main.rs rename to src/test/ui/panics/panic-main.rs index 881eb7b5823b7..87df7688f0b40 100644 --- a/src/test/run-fail/panic-main.rs +++ b/src/test/ui/panics/panic-main.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:moop +// ignore-emscripten no processes + fn main() { panic!("moop"); } diff --git a/src/test/run-fail/panic-parens.rs b/src/test/ui/panics/panic-parens.rs similarity index 86% rename from src/test/run-fail/panic-parens.rs rename to src/test/ui/panics/panic-parens.rs index e7f98e58c4f39..59ab544464967 100644 --- a/src/test/run-fail/panic-parens.rs +++ b/src/test/ui/panics/panic-parens.rs @@ -1,6 +1,9 @@ // Fail macros without arguments need to be disambiguated in // certain positions + +// run-fail // error-pattern:oops +// ignore-emscripten no processes fn bigpanic() { while (panic!("oops")) { diff --git a/src/test/run-fail/panic-set-handler.rs b/src/test/ui/panics/panic-set-handler.rs similarity index 81% rename from src/test/run-fail/panic-set-handler.rs rename to src/test/ui/panics/panic-set-handler.rs index ea2b152c6c45a..3c00183e253d7 100644 --- a/src/test/run-fail/panic-set-handler.rs +++ b/src/test/ui/panics/panic-set-handler.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:greetings from the panic handler +// ignore-emscripten no processes use std::panic; diff --git a/src/test/run-fail/panic-set-unset-handler.rs b/src/test/ui/panics/panic-set-unset-handler.rs similarity index 83% rename from src/test/run-fail/panic-set-unset-handler.rs rename to src/test/ui/panics/panic-set-unset-handler.rs index f8809c2f3889e..dde0c72f76550 100644 --- a/src/test/run-fail/panic-set-unset-handler.rs +++ b/src/test/ui/panics/panic-set-unset-handler.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'foobar' +// ignore-emscripten no processes use std::panic; diff --git a/src/test/run-fail/panic-take-handler-nop.rs b/src/test/ui/panics/panic-take-handler-nop.rs similarity index 73% rename from src/test/run-fail/panic-take-handler-nop.rs rename to src/test/ui/panics/panic-take-handler-nop.rs index bb191a38f8473..41cbac97c443f 100644 --- a/src/test/run-fail/panic-take-handler-nop.rs +++ b/src/test/ui/panics/panic-take-handler-nop.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:thread 'main' panicked at 'foobar' +// ignore-emscripten no processes use std::panic; diff --git a/src/test/run-fail/panic-task-name-none.rs b/src/test/ui/panics/panic-task-name-none.rs similarity index 96% rename from src/test/run-fail/panic-task-name-none.rs rename to src/test/ui/panics/panic-task-name-none.rs index c7f504046baed..4e95fb5bdb803 100644 --- a/src/test/run-fail/panic-task-name-none.rs +++ b/src/test/ui/panics/panic-task-name-none.rs @@ -1,3 +1,4 @@ +// run-fail // error-pattern:thread '' panicked at 'test' // ignore-emscripten Needs threads diff --git a/src/test/run-fail/panic-task-name-owned.rs b/src/test/ui/panics/panic-task-name-owned.rs similarity index 97% rename from src/test/run-fail/panic-task-name-owned.rs rename to src/test/ui/panics/panic-task-name-owned.rs index 58f76ff787f9f..f85be7bb8e299 100644 --- a/src/test/run-fail/panic-task-name-owned.rs +++ b/src/test/ui/panics/panic-task-name-owned.rs @@ -1,3 +1,4 @@ +// run-fail // error-pattern:thread 'owned name' panicked at 'test' // ignore-emscripten Needs threads. diff --git a/src/test/run-fail/panic.rs b/src/test/ui/panics/panic.rs similarity index 55% rename from src/test/run-fail/panic.rs rename to src/test/ui/panics/panic.rs index 95f20dedad26c..b6227a582ce0b 100644 --- a/src/test/run-fail/panic.rs +++ b/src/test/ui/panics/panic.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:1 == 2 +// ignore-emscripten no processes + fn main() { assert!(1 == 2); } diff --git a/src/test/run-fail/result-get-panic.rs b/src/test/ui/panics/result-get-panic.rs similarity index 79% rename from src/test/run-fail/result-get-panic.rs rename to src/test/ui/panics/result-get-panic.rs index cddf20ee49df3..461f30b9134b0 100644 --- a/src/test/run-fail/result-get-panic.rs +++ b/src/test/ui/panics/result-get-panic.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:called `Result::unwrap()` on an `Err` value +// ignore-emscripten no processes use std::result::Result::Err; diff --git a/src/test/run-fail/test-panic.rs b/src/test/ui/panics/test-panic.rs similarity index 68% rename from src/test/run-fail/test-panic.rs rename to src/test/ui/panics/test-panic.rs index 92f5146b710f2..85c9279cdf27b 100644 --- a/src/test/run-fail/test-panic.rs +++ b/src/test/ui/panics/test-panic.rs @@ -1,5 +1,5 @@ +// run-fail // check-stdout -// error-pattern:thread 'test_foo' panicked at // compile-flags: --test // ignore-emscripten diff --git a/src/test/run-fail/test-should-fail-bad-message.rs b/src/test/ui/panics/test-should-fail-bad-message.rs similarity index 75% rename from src/test/run-fail/test-should-fail-bad-message.rs rename to src/test/ui/panics/test-should-fail-bad-message.rs index 3c69bb07d3b18..701f267764858 100644 --- a/src/test/run-fail/test-should-fail-bad-message.rs +++ b/src/test/ui/panics/test-should-fail-bad-message.rs @@ -1,5 +1,5 @@ +// run-fail // check-stdout -// error-pattern:thread 'test_foo' panicked at // compile-flags: --test // ignore-emscripten diff --git a/src/test/run-fail/test-should-panic-bad-message.rs b/src/test/ui/panics/test-should-panic-bad-message.rs similarity index 72% rename from src/test/run-fail/test-should-panic-bad-message.rs rename to src/test/ui/panics/test-should-panic-bad-message.rs index b73d4d7377a34..a82c4e1440aae 100644 --- a/src/test/run-fail/test-should-panic-bad-message.rs +++ b/src/test/ui/panics/test-should-panic-bad-message.rs @@ -1,7 +1,8 @@ +// run-fail // compile-flags: --test - -// error-pattern:panicked at 'bar' // check-stdout +// ignore-emscripten no processes + #[test] #[should_panic(expected = "foo")] pub fn test_bar() { diff --git a/src/test/run-fail/test-should-panic-no-message.rs b/src/test/ui/panics/test-should-panic-no-message.rs similarity index 72% rename from src/test/run-fail/test-should-panic-no-message.rs rename to src/test/ui/panics/test-should-panic-no-message.rs index b18389ec7440e..13f67a41cdd53 100644 --- a/src/test/run-fail/test-should-panic-no-message.rs +++ b/src/test/ui/panics/test-should-panic-no-message.rs @@ -1,7 +1,8 @@ +// run-fail // compile-flags: --test - -// error-pattern:panicked at 'explicit panic' // check-stdout +// ignore-emscripten no processes + #[test] #[should_panic(expected = "foo")] pub fn test_explicit() { diff --git a/src/test/run-fail/unique-panic.rs b/src/test/ui/panics/unique-panic.rs similarity index 84% rename from src/test/run-fail/unique-panic.rs rename to src/test/ui/panics/unique-panic.rs index adefd796af492..22e0d63d5946f 100644 --- a/src/test/run-fail/unique-panic.rs +++ b/src/test/ui/panics/unique-panic.rs @@ -1,3 +1,4 @@ +// run-fail // error-pattern: panic fn main() { diff --git a/src/test/run-fail/while-body-panics.rs b/src/test/ui/panics/while-body-panics.rs similarity index 76% rename from src/test/run-fail/while-body-panics.rs rename to src/test/ui/panics/while-body-panics.rs index 76acb4ba42de4..2c05eb389ccfe 100644 --- a/src/test/run-fail/while-body-panics.rs +++ b/src/test/ui/panics/while-body-panics.rs @@ -1,6 +1,9 @@ #![allow(while_true)] +// run-fail // error-pattern:quux +// ignore-emscripten no processes + fn main() { let _x: isize = { while true { diff --git a/src/test/run-fail/while-panic.rs b/src/test/ui/panics/while-panic.rs similarity index 77% rename from src/test/run-fail/while-panic.rs rename to src/test/ui/panics/while-panic.rs index a0827591729f7..857f65a225228 100644 --- a/src/test/run-fail/while-panic.rs +++ b/src/test/ui/panics/while-panic.rs @@ -1,6 +1,9 @@ #![allow(while_true)] +// run-fail // error-pattern:giraffe +// ignore-emscripten no processes + fn main() { panic!({ while true { diff --git a/src/test/run-fail/tls-exit-status.rs b/src/test/ui/process/tls-exit-status.rs similarity index 79% rename from src/test/run-fail/tls-exit-status.rs rename to src/test/ui/process/tls-exit-status.rs index f15fd4f6894f7..36d6aff9e7730 100644 --- a/src/test/run-fail/tls-exit-status.rs +++ b/src/test/ui/process/tls-exit-status.rs @@ -1,6 +1,8 @@ +// run-fail // error-pattern:nonzero // exec-env:RUST_NEWRT=1 // ignore-cloudabi no std::env +// ignore-emscripten no processes use std::env; diff --git a/src/test/run-fail/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 similarity index 84% rename from src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs rename to src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs index 796729ac4cc28..10dc6115dcb20 100644 --- a/src/test/run-fail/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 @@ -1,5 +1,7 @@ +// run-fail // error-pattern:returned Box from main() // failure-status: 1 +// ignore-emscripten no processes use std::error::Error; use std::io; diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-never.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs similarity index 60% rename from src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-never.rs rename to src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs index cb37b8e067090..faf2526c8d8fd 100644 --- a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-never.rs +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs @@ -1,4 +1,6 @@ +// run-fail // error-pattern:oh, dear +// ignore-emscripten no processes fn main() -> ! { panic!("oh, dear"); diff --git a/src/test/run-fail/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 similarity index 83% rename from src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs rename to src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs index 2f3a73a30ad95..6a625fb05e8f8 100644 --- a/src/test/run-fail/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 @@ -1,5 +1,7 @@ +// run-fail // error-pattern:returned Box from main() // failure-status: 1 +// ignore-emscripten no processes use std::io::{Error, ErrorKind}; diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-str.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs similarity index 75% rename from src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-str.rs rename to src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs index bd6fa8af93513..94f16c6fd0212 100644 --- a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-str.rs +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs @@ -1,5 +1,7 @@ +// run-fail // error-pattern: An error message for you // failure-status: 1 +// ignore-emscripten no processes fn main() -> Result<(), &'static str> { Err("An error message for you") diff --git a/src/test/run-fail/str-overrun.rs b/src/test/ui/str/str-overrun.rs similarity index 80% rename from src/test/run-fail/str-overrun.rs rename to src/test/ui/str/str-overrun.rs index e566308a08767..a3ec8941322d5 100644 --- a/src/test/run-fail/str-overrun.rs +++ b/src/test/ui/str/str-overrun.rs @@ -1,4 +1,7 @@ +// run-fail // error-pattern:index out of bounds: the len is 5 but the index is 5 +// ignore-emscripten no processes + fn main() { let s: String = "hello".to_string(); diff --git a/src/test/run-fail/rhs-type.rs b/src/test/ui/structs/rhs-type.rs similarity index 85% rename from src/test/run-fail/rhs-type.rs rename to src/test/ui/structs/rhs-type.rs index 6efbeadd70421..c48e7c08ed2da 100644 --- a/src/test/run-fail/rhs-type.rs +++ b/src/test/ui/structs/rhs-type.rs @@ -1,6 +1,9 @@ // Tests that codegen treats the rhs of pth's decl // as a _|_-typed thing, not a str-typed thing + +// run-fail // error-pattern:bye +// ignore-emscripten no processes #![allow(unreachable_code)] #![allow(unused_variables)] diff --git a/src/test/run-fail/run-unexported-tests.rs b/src/test/ui/test-attrs/run-unexported-tests.rs similarity index 79% rename from src/test/run-fail/run-unexported-tests.rs rename to src/test/ui/test-attrs/run-unexported-tests.rs index 11e100e716eb4..f533a3ef885d6 100644 --- a/src/test/run-fail/run-unexported-tests.rs +++ b/src/test/ui/test-attrs/run-unexported-tests.rs @@ -1,4 +1,4 @@ -// error-pattern:ran an unexported test +// run-fail // compile-flags:--test // check-stdout diff --git a/src/test/run-fail/task-spawn-barefn.rs b/src/test/ui/threads-sendsync/task-spawn-barefn.rs similarity index 97% rename from src/test/run-fail/task-spawn-barefn.rs rename to src/test/ui/threads-sendsync/task-spawn-barefn.rs index 497c5ea71804f..e5b899e0af967 100644 --- a/src/test/run-fail/task-spawn-barefn.rs +++ b/src/test/ui/threads-sendsync/task-spawn-barefn.rs @@ -1,3 +1,4 @@ +// run-fail // error-pattern:Ensure that the child thread runs by panicking // ignore-emscripten Needs threads. diff --git a/src/test/run-fail/test-tasks-invalid-value.rs b/src/test/ui/threads-sendsync/test-tasks-invalid-value.rs similarity index 95% rename from src/test/run-fail/test-tasks-invalid-value.rs rename to src/test/ui/threads-sendsync/test-tasks-invalid-value.rs index 2dae1b4592c0f..6411421429c4c 100644 --- a/src/test/run-fail/test-tasks-invalid-value.rs +++ b/src/test/ui/threads-sendsync/test-tasks-invalid-value.rs @@ -1,6 +1,7 @@ // 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 diff --git a/src/test/run-fail/vec-overrun.rs b/src/test/ui/vec/vec-overrun.rs similarity index 83% rename from src/test/run-fail/vec-overrun.rs rename to src/test/ui/vec/vec-overrun.rs index 2be945f736cb7..bdc7d507d5305 100644 --- a/src/test/run-fail/vec-overrun.rs +++ b/src/test/ui/vec/vec-overrun.rs @@ -1,5 +1,6 @@ +// run-fail // error-pattern:index out of bounds: the len is 1 but the index is 2 - +// ignore-emscripten no processes fn main() { let v: Vec = vec![10];