diff --git a/tests/ui/auxiliary/removing-extern-crate.rs b/tests/ui/auxiliary/removing-extern-crate.rs deleted file mode 100644 index 65e2cc340450f..0000000000000 --- a/tests/ui/auxiliary/removing-extern-crate.rs +++ /dev/null @@ -1 +0,0 @@ -// intentionally blank diff --git a/tests/ui/catch-unwind-bang.rs b/tests/ui/catch-unwind-bang.rs deleted file mode 100644 index c874c649f3330..0000000000000 --- a/tests/ui/catch-unwind-bang.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ run-pass -//@ needs-unwind - -fn worker() -> ! { - panic!() -} - -fn main() { - std::panic::catch_unwind(worker).unwrap_err(); -} diff --git a/tests/ui/cfguard-run.rs b/tests/ui/codegen/cfguard-run.rs similarity index 100% rename from tests/ui/cfguard-run.rs rename to tests/ui/codegen/cfguard-run.rs diff --git a/tests/ui/error-festival.rs b/tests/ui/error-emitter/error-festival.rs similarity index 86% rename from tests/ui/error-festival.rs rename to tests/ui/error-emitter/error-festival.rs index 356564e54077a..ebb5882352cba 100644 --- a/tests/ui/error-festival.rs +++ b/tests/ui/error-emitter/error-festival.rs @@ -1,3 +1,5 @@ +//! Check that if there are a lot of errors we truncate the list of errors appropriately + enum Question { Yes, No, diff --git a/tests/ui/error-festival.stderr b/tests/ui/error-emitter/error-festival.stderr similarity index 86% rename from tests/ui/error-festival.stderr rename to tests/ui/error-emitter/error-festival.stderr index 9db9536379141..be484bc8094fe 100644 --- a/tests/ui/error-festival.stderr +++ b/tests/ui/error-emitter/error-festival.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `y` in this scope - --> $DIR/error-festival.rs:14:5 + --> $DIR/error-festival.rs:16:5 | LL | y = 2; | ^ @@ -15,19 +15,19 @@ LL | let y = 2; | +++ error[E0603]: constant `FOO` is private - --> $DIR/error-festival.rs:22:10 + --> $DIR/error-festival.rs:24:10 | LL | foo::FOO; | ^^^ private constant | note: the constant `FOO` is defined here - --> $DIR/error-festival.rs:7:5 + --> $DIR/error-festival.rs:9:5 | LL | const FOO: u32 = 0; | ^^^^^^^^^^^^^^^^^^^ error[E0368]: binary assignment operation `+=` cannot be applied to type `&str` - --> $DIR/error-festival.rs:12:5 + --> $DIR/error-festival.rs:14:5 | LL | x += 2; | -^^^^^ @@ -35,19 +35,19 @@ LL | x += 2; | cannot use `+=` on type `&str` error[E0599]: no method named `z` found for reference `&str` in the current scope - --> $DIR/error-festival.rs:16:7 + --> $DIR/error-festival.rs:18:7 | LL | x.z(); | ^ method not found in `&str` error[E0600]: cannot apply unary operator `!` to type `Question` - --> $DIR/error-festival.rs:19:5 + --> $DIR/error-festival.rs:21:5 | LL | !Question::Yes; | ^^^^^^^^^^^^^^ cannot apply unary operator `!` | note: an implementation of `Not` might be missing for `Question` - --> $DIR/error-festival.rs:1:1 + --> $DIR/error-festival.rs:3:1 | LL | enum Question { | ^^^^^^^^^^^^^ must implement `Not` @@ -55,7 +55,7 @@ note: the trait `Not` must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error[E0604]: only `u8` can be cast as `char`, not `u32` - --> $DIR/error-festival.rs:25:5 + --> $DIR/error-festival.rs:27:5 | LL | 0u32 as char; | ^^^^^^^^^^^^ @@ -64,13 +64,13 @@ LL | 0u32 as char; | help: try `char::from_u32` instead: `char::from_u32(0u32)` error[E0605]: non-primitive cast: `u8` as `Vec` - --> $DIR/error-festival.rs:29:5 + --> $DIR/error-festival.rs:31:5 | LL | x as Vec; | ^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object error[E0054]: cannot cast `{integer}` as `bool` - --> $DIR/error-festival.rs:33:24 + --> $DIR/error-festival.rs:35:24 | LL | let x_is_nonzero = x as bool; | ^^^^^^^^^ @@ -82,7 +82,7 @@ LL + let x_is_nonzero = x != 0; | error[E0606]: casting `&u8` as `u32` is invalid - --> $DIR/error-festival.rs:37:18 + --> $DIR/error-festival.rs:39:18 | LL | let y: u32 = x as u32; | ^^^^^^^^ @@ -93,7 +93,7 @@ LL | let y: u32 = *x as u32; | + error[E0607]: cannot cast thin pointer `*const u8` to wide pointer `*const [u8]` - --> $DIR/error-festival.rs:41:5 + --> $DIR/error-festival.rs:43:5 | LL | v as *const [u8]; | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/non-copyable-void.rs b/tests/ui/non-copyable-void.rs deleted file mode 100644 index 55bad82bc339d..0000000000000 --- a/tests/ui/non-copyable-void.rs +++ /dev/null @@ -1,10 +0,0 @@ -use std::ffi::c_void; - -fn main() { - let x : *const Vec = &vec![1,2,3]; - let y : *const c_void = x as *const c_void; - unsafe { - let _z = (*y).clone(); - //~^ ERROR no method named `clone` found - } -} diff --git a/tests/ui/non-copyable-void.stderr b/tests/ui/non-copyable-void.stderr deleted file mode 100644 index 373557fa01a4b..0000000000000 --- a/tests/ui/non-copyable-void.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0599]: no method named `clone` found for enum `c_void` in the current scope - --> $DIR/non-copyable-void.rs:7:23 - | -LL | let _z = (*y).clone(); - | ^^^^^ method not found in `c_void` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/panics/catch-unwind-bang.rs b/tests/ui/panics/catch-unwind-bang.rs new file mode 100644 index 0000000000000..80eb377e5ca13 --- /dev/null +++ b/tests/ui/panics/catch-unwind-bang.rs @@ -0,0 +1,15 @@ +//! Check that the unwind machinery handles uninhabited types correctly. +//! It used to call `std::mem::uninitialized::();` at some point... +//! +//! See + +//@ run-pass +//@ needs-unwind + +fn worker() -> ! { + panic!() +} + +fn main() { + std::panic::catch_unwind(worker).unwrap_err(); +} diff --git a/tests/ui/rust-2018/auxiliary/dummy-crate.rs b/tests/ui/rust-2018/auxiliary/dummy-crate.rs new file mode 100644 index 0000000000000..c9e8881600dea --- /dev/null +++ b/tests/ui/rust-2018/auxiliary/dummy-crate.rs @@ -0,0 +1,2 @@ +// intentionally blank, used because we need an extern crate for +// `removing-extern-crate.rs` but don't care about what's in it. diff --git a/tests/ui/removing-extern-crate.fixed b/tests/ui/rust-2018/removing-extern-crate.fixed similarity index 86% rename from tests/ui/removing-extern-crate.fixed rename to tests/ui/rust-2018/removing-extern-crate.fixed index 477161fba804d..e88a84cc93e2a 100644 --- a/tests/ui/removing-extern-crate.fixed +++ b/tests/ui/rust-2018/removing-extern-crate.fixed @@ -1,5 +1,5 @@ //@ edition:2018 -//@ aux-build:removing-extern-crate.rs +//@ aux-build:dummy-crate.rs //@ run-rustfix //@ check-pass diff --git a/tests/ui/removing-extern-crate.rs b/tests/ui/rust-2018/removing-extern-crate.rs similarity index 52% rename from tests/ui/removing-extern-crate.rs rename to tests/ui/rust-2018/removing-extern-crate.rs index 0b819482c7101..844377945e02f 100644 --- a/tests/ui/removing-extern-crate.rs +++ b/tests/ui/rust-2018/removing-extern-crate.rs @@ -1,15 +1,15 @@ //@ edition:2018 -//@ aux-build:removing-extern-crate.rs +//@ aux-build:dummy-crate.rs //@ run-rustfix //@ check-pass #![warn(rust_2018_idioms)] -extern crate removing_extern_crate as foo; //~ WARNING unused extern crate +extern crate dummy_crate as foo; //~ WARNING unused extern crate extern crate core; //~ WARNING unused extern crate mod another { - extern crate removing_extern_crate as foo; //~ WARNING unused extern crate + extern crate dummy_crate as foo; //~ WARNING unused extern crate extern crate core; //~ WARNING unused extern crate } diff --git a/tests/ui/removing-extern-crate.stderr b/tests/ui/rust-2018/removing-extern-crate.stderr similarity index 75% rename from tests/ui/removing-extern-crate.stderr rename to tests/ui/rust-2018/removing-extern-crate.stderr index 4dddf160ce27b..573125426404d 100644 --- a/tests/ui/removing-extern-crate.stderr +++ b/tests/ui/rust-2018/removing-extern-crate.stderr @@ -1,8 +1,8 @@ warning: unused extern crate --> $DIR/removing-extern-crate.rs:8:1 | -LL | extern crate removing_extern_crate as foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it +LL | extern crate dummy_crate as foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it | note: the lint level is defined here --> $DIR/removing-extern-crate.rs:6:9 @@ -20,8 +20,8 @@ LL | extern crate core; warning: unused extern crate --> $DIR/removing-extern-crate.rs:12:5 | -LL | extern crate removing_extern_crate as foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it +LL | extern crate dummy_crate as foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it warning: unused extern crate --> $DIR/removing-extern-crate.rs:13:5