diff --git a/src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs b/src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs deleted file mode 100644 index abe34a39caf34..0000000000000 --- a/src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs +++ /dev/null @@ -1,15 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "rlib"] - -#![no_std] -#![feature(lang_items)] - -use core::panic::PanicInfo; - -#[lang = "panic_impl"] -fn panic_impl(info: &PanicInfo) -> ! { loop {} } -#[lang = "eh_personality"] -fn eh_personality() {} -#[lang = "eh_unwind_resume"] -fn eh_unwind_resume() {} diff --git a/src/test/compile-fail/auxiliary/panic-runtime-unwind.rs b/src/test/compile-fail/auxiliary/panic-runtime-unwind.rs deleted file mode 100644 index 97452a342ab4d..0000000000000 --- a/src/test/compile-fail/auxiliary/panic-runtime-unwind.rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags:-C panic=unwind -// no-prefer-dynamic - -#![feature(panic_runtime)] -#![crate_type = "rlib"] - -#![no_std] -#![panic_runtime] - -#[no_mangle] -pub extern fn __rust_maybe_catch_panic() {} - -#[no_mangle] -pub extern fn __rust_start_panic() {} - -#[no_mangle] -pub extern fn rust_eh_personality() {} diff --git a/src/test/compile-fail/auxiliary/panic-runtime-unwind2.rs b/src/test/compile-fail/auxiliary/panic-runtime-unwind2.rs deleted file mode 100644 index 97452a342ab4d..0000000000000 --- a/src/test/compile-fail/auxiliary/panic-runtime-unwind2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags:-C panic=unwind -// no-prefer-dynamic - -#![feature(panic_runtime)] -#![crate_type = "rlib"] - -#![no_std] -#![panic_runtime] - -#[no_mangle] -pub extern fn __rust_maybe_catch_panic() {} - -#[no_mangle] -pub extern fn __rust_start_panic() {} - -#[no_mangle] -pub extern fn rust_eh_personality() {} diff --git a/src/test/compile-fail/auxiliary/some-panic-impl.rs b/src/test/compile-fail/auxiliary/some-panic-impl.rs deleted file mode 100644 index 0348b3a2d760b..0000000000000 --- a/src/test/compile-fail/auxiliary/some-panic-impl.rs +++ /dev/null @@ -1,11 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "rlib"] -#![no_std] - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic(info: &PanicInfo) -> ! { - loop {} -} diff --git a/src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs b/src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs deleted file mode 100644 index d5f0102196f48..0000000000000 --- a/src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs +++ /dev/null @@ -1,6 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "rlib"] -#![no_std] - -extern crate panic_runtime_unwind; diff --git a/src/test/compile-fail/asm-src-loc.rs b/src/test/ui/asm/asm-src-loc.rs similarity index 100% rename from src/test/compile-fail/asm-src-loc.rs rename to src/test/ui/asm/asm-src-loc.rs diff --git a/src/test/ui/asm/asm-src-loc.stderr b/src/test/ui/asm/asm-src-loc.stderr new file mode 100644 index 0000000000000..c87e413bdcb36 --- /dev/null +++ b/src/test/ui/asm/asm-src-loc.stderr @@ -0,0 +1,11 @@ +error: :1:2: error: invalid instruction mnemonic 'nowayisthisavalidinstruction' + nowayisthisavalidinstruction + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + --> $DIR/asm-src-loc.rs:7:9 + | +LL | asm!("nowayisthisavalidinstruction"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-23595-1.rs b/src/test/ui/associated-types/issue-23595-1.rs similarity index 100% rename from src/test/compile-fail/issue-23595-1.rs rename to src/test/ui/associated-types/issue-23595-1.rs diff --git a/src/test/ui/associated-types/issue-23595-1.stderr b/src/test/ui/associated-types/issue-23595-1.stderr new file mode 100644 index 0000000000000..ec9c9d4d44d71 --- /dev/null +++ b/src/test/ui/associated-types/issue-23595-1.stderr @@ -0,0 +1,18 @@ +error[E0191]: the value of the associated types `Value` (from the trait `Hierarchy`), `ChildKey` (from the trait `Hierarchy`), `Children` (from the trait `Hierarchy`) must be specified + --> $DIR/issue-23595-1.rs:8:54 + | +LL | type Value; + | ----------- `Value` defined here +LL | type ChildKey; + | -------------- `ChildKey` defined here +LL | type Children = dyn Index; + | -------------------------------------------------^^^^^^^^^^^^^-- + | | | + | | associated type `Value` must be specified + | | associated type `ChildKey` must be specified + | | associated type `Children` must be specified + | `Children` defined here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0191`. diff --git a/src/test/compile-fail/chalkify/chalk_initial_program.rs b/src/test/ui/chalkify/chalk_initial_program.rs similarity index 100% rename from src/test/compile-fail/chalkify/chalk_initial_program.rs rename to src/test/ui/chalkify/chalk_initial_program.rs diff --git a/src/test/ui/chalkify/chalk_initial_program.stderr b/src/test/ui/chalkify/chalk_initial_program.stderr new file mode 100644 index 0000000000000..1319e6fca916d --- /dev/null +++ b/src/test/ui/chalkify/chalk_initial_program.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `f32: Foo` is not satisfied + --> $DIR/chalk_initial_program.rs:15:5 + | +LL | gimme::(); + | ^^^^^^^^^^^^ the trait `Foo` is not implemented for `f32` + | +note: required by `gimme` + --> $DIR/chalk_initial_program.rs:9:1 + | +LL | fn gimme() { } + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/chalkify/generic_impls.rs b/src/test/ui/chalkify/generic_impls.rs similarity index 100% rename from src/test/compile-fail/chalkify/generic_impls.rs rename to src/test/ui/chalkify/generic_impls.rs diff --git a/src/test/ui/chalkify/generic_impls.stderr b/src/test/ui/chalkify/generic_impls.stderr new file mode 100644 index 0000000000000..73f0e444be917 --- /dev/null +++ b/src/test/ui/chalkify/generic_impls.stderr @@ -0,0 +1,31 @@ +error[E0277]: the trait bound `(std::option::Option, f32): Foo` is not satisfied + --> $DIR/generic_impls.rs:12:5 + | +LL | gimme::<(Option, f32)>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(std::option::Option, f32)` + | + = help: the following implementations were found: + <(T, u32) as Foo> +note: required by `gimme` + --> $DIR/generic_impls.rs:7:1 + | +LL | fn gimme() { } + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `(i32, f32): Foo` is not satisfied + --> $DIR/generic_impls.rs:17:5 + | +LL | gimme::<(i32, f32)>(); + | ^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(i32, f32)` + | + = help: the following implementations were found: + <(T, u32) as Foo> +note: required by `gimme` + --> $DIR/generic_impls.rs:7:1 + | +LL | fn gimme() { } + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/chalkify/type_wf.rs b/src/test/ui/chalkify/type_wf.rs similarity index 100% rename from src/test/compile-fail/chalkify/type_wf.rs rename to src/test/ui/chalkify/type_wf.rs diff --git a/src/test/ui/chalkify/type_wf.stderr b/src/test/ui/chalkify/type_wf.stderr new file mode 100644 index 0000000000000..593a1fba50d9e --- /dev/null +++ b/src/test/ui/chalkify/type_wf.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `{float}: Foo` is not satisfied + --> $DIR/type_wf.rs:17:13 + | +LL | let s = S { + | ^ the trait `Foo` is not implemented for `{float}` + | + = help: the following implementations were found: + + as Foo> +note: required by `S` + --> $DIR/type_wf.rs:5:1 + | +LL | struct S { + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/coerce-unsafe-closure-to-unsafe-fn-ptr.rs b/src/test/ui/coercion/coerce-unsafe-closure-to-unsafe-fn-ptr.rs similarity index 100% rename from src/test/compile-fail/coerce-unsafe-closure-to-unsafe-fn-ptr.rs rename to src/test/ui/coercion/coerce-unsafe-closure-to-unsafe-fn-ptr.rs diff --git a/src/test/ui/coercion/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr b/src/test/ui/coercion/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr new file mode 100644 index 0000000000000..a1fb1c02e4622 --- /dev/null +++ b/src/test/ui/coercion/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:2:31 + | +LL | let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/const-err3.rs b/src/test/ui/consts/const-err3.rs similarity index 100% rename from src/test/compile-fail/const-err3.rs rename to src/test/ui/consts/const-err3.rs diff --git a/src/test/ui/consts/const-err3.stderr b/src/test/ui/consts/const-err3.stderr new file mode 100644 index 0000000000000..467aab501227b --- /dev/null +++ b/src/test/ui/consts/const-err3.stderr @@ -0,0 +1,32 @@ +error: this expression will panic at runtime + --> $DIR/const-err3.rs:9:13 + | +LL | let b = 200u8 + 200u8 + 200u8; + | ^^^^^^^^^^^^^ attempt to add with overflow + | +note: lint level defined here + --> $DIR/const-err3.rs:2:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/const-err3.rs:11:13 + | +LL | let c = 200u8 * 4; + | ^^^^^^^^^ attempt to multiply with overflow + +error: this expression will panic at runtime + --> $DIR/const-err3.rs:13:13 + | +LL | let d = 42u8 - (42u8 + 1); + | ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow + +error: index out of bounds: the len is 1 but the index is 1 + --> $DIR/const-err3.rs:15:14 + | +LL | let _e = [5u8][1]; + | ^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/const-fn-error.rs b/src/test/ui/consts/const-fn-error.rs similarity index 100% rename from src/test/compile-fail/const-fn-error.rs rename to src/test/ui/consts/const-fn-error.rs diff --git a/src/test/ui/consts/const-fn-error.stderr b/src/test/ui/consts/const-fn-error.stderr new file mode 100644 index 0000000000000..392caaa78634a --- /dev/null +++ b/src/test/ui/consts/const-fn-error.stderr @@ -0,0 +1,34 @@ +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants + --> $DIR/const-fn-error.rs:7:14 + | +LL | for i in 0..x { + | ^^^^ + +error[E0019]: constant function contains unimplemented expression type + --> $DIR/const-fn-error.rs:7:14 + | +LL | for i in 0..x { + | ^^^^ + +error[E0019]: constant function contains unimplemented expression type + --> $DIR/const-fn-error.rs:7:5 + | +LL | / for i in 0..x { +LL | | +LL | | +LL | | +LL | | +LL | | sum += i; +LL | | } + | |_____^ + +error[E0080]: evaluation of constant value failed + --> $DIR/const-fn-error.rs:7:14 + | +LL | for i in 0..x { + | ^^^^ calling non-const function ` as std::iter::IntoIterator>::into_iter` + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0015, E0019, E0080. +For more information about an error, try `rustc --explain E0015`. diff --git a/src/test/compile-fail/issue-52443.rs b/src/test/ui/consts/issue-52443.rs similarity index 100% rename from src/test/compile-fail/issue-52443.rs rename to src/test/ui/consts/issue-52443.rs diff --git a/src/test/ui/consts/issue-52443.stderr b/src/test/ui/consts/issue-52443.stderr new file mode 100644 index 0000000000000..f6aa3bf61e881 --- /dev/null +++ b/src/test/ui/consts/issue-52443.stderr @@ -0,0 +1,55 @@ +error[E0308]: mismatched types + --> $DIR/issue-52443.rs:2:10 + | +LL | [(); & { loop { continue } } ]; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected usize, found reference + | help: consider removing the borrow: `{ loop { continue } }` + | + = note: expected type `usize` + found type `&_` + +error[E0308]: mismatched types + --> $DIR/issue-52443.rs:3:17 + | +LL | [(); loop { break }]; + | ^^^^^ expected (), found usize + | + = note: expected type `()` + found type `usize` + +error[E0019]: constant contains unimplemented expression type + --> $DIR/issue-52443.rs:4:11 + | +LL | [(); {while true {break}; 0}]; + | ^^^^^^^^^^^^^^^^^^ + +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-52443.rs:5:21 + | +LL | [(); { for _ in 0usize.. {}; 0}]; + | ^^^^^^^^ + +error[E0019]: constant contains unimplemented expression type + --> $DIR/issue-52443.rs:5:21 + | +LL | [(); { for _ in 0usize.. {}; 0}]; + | ^^^^^^^^ + +error[E0019]: constant contains unimplemented expression type + --> $DIR/issue-52443.rs:5:12 + | +LL | [(); { for _ in 0usize.. {}; 0}]; + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0080]: evaluation of constant value failed + --> $DIR/issue-52443.rs:5:21 + | +LL | [(); { for _ in 0usize.. {}; 0}]; + | ^^^^^^^^ calling non-const function ` as std::iter::IntoIterator>::into_iter` + +error: aborting due to 7 previous errors + +Some errors have detailed explanations: E0015, E0019, E0080, E0308. +For more information about an error, try `rustc --explain E0015`. diff --git a/src/test/ui/imports/empty-extern-arg-wasm.rs b/src/test/ui/imports/empty-extern-arg-wasm.rs new file mode 100644 index 0000000000000..572fb85c24599 --- /dev/null +++ b/src/test/ui/imports/empty-extern-arg-wasm.rs @@ -0,0 +1,5 @@ +// compile-flags: --extern std= +// error-pattern: can't find crate for `std` +// only-wasm32 + +fn main() {} diff --git a/src/test/ui/imports/empty-extern-arg-wasm.stderr b/src/test/ui/imports/empty-extern-arg-wasm.stderr new file mode 100644 index 0000000000000..26dba1c2363ef --- /dev/null +++ b/src/test/ui/imports/empty-extern-arg-wasm.stderr @@ -0,0 +1,9 @@ +error: extern location for std does not exist: + +error[E0463]: can't find crate for `std` + | + = note: the `wasm32-unknown-unknown` target may not be installed + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/empty-extern-arg.rs b/src/test/ui/imports/empty-extern-arg.rs similarity index 84% rename from src/test/compile-fail/empty-extern-arg.rs rename to src/test/ui/imports/empty-extern-arg.rs index ae28fcad903be..730a0225516f9 100644 --- a/src/test/compile-fail/empty-extern-arg.rs +++ b/src/test/ui/imports/empty-extern-arg.rs @@ -1,4 +1,5 @@ // compile-flags: --extern std= // error-pattern: can't find crate for `std` +// ignore-wasm32 fn main() {} diff --git a/src/test/ui/imports/empty-extern-arg.stderr b/src/test/ui/imports/empty-extern-arg.stderr new file mode 100644 index 0000000000000..c81a647b094f9 --- /dev/null +++ b/src/test/ui/imports/empty-extern-arg.stderr @@ -0,0 +1,7 @@ +error: extern location for std does not exist: + +error[E0463]: can't find crate for `std` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/auxiliary/weak-lang-items.rs b/src/test/ui/lang-item/auxiliary/weak-lang-items.rs similarity index 100% rename from src/test/compile-fail/auxiliary/weak-lang-items.rs rename to src/test/ui/lang-item/auxiliary/weak-lang-items.rs diff --git a/src/test/ui/lang-item-missing.rs b/src/test/ui/lang-item/lang-item-missing.rs similarity index 100% rename from src/test/ui/lang-item-missing.rs rename to src/test/ui/lang-item/lang-item-missing.rs diff --git a/src/test/ui/lang-item-missing.stderr b/src/test/ui/lang-item/lang-item-missing.stderr similarity index 100% rename from src/test/ui/lang-item-missing.stderr rename to src/test/ui/lang-item/lang-item-missing.stderr diff --git a/src/test/ui/required-lang-item.rs b/src/test/ui/lang-item/required-lang-item.rs similarity index 100% rename from src/test/ui/required-lang-item.rs rename to src/test/ui/lang-item/required-lang-item.rs diff --git a/src/test/ui/required-lang-item.stderr b/src/test/ui/lang-item/required-lang-item.stderr similarity index 100% rename from src/test/ui/required-lang-item.stderr rename to src/test/ui/lang-item/required-lang-item.stderr diff --git a/src/test/ui/unknown-language-item.rs b/src/test/ui/lang-item/unknown-language-item.rs similarity index 100% rename from src/test/ui/unknown-language-item.rs rename to src/test/ui/lang-item/unknown-language-item.rs diff --git a/src/test/ui/unknown-language-item.stderr b/src/test/ui/lang-item/unknown-language-item.stderr similarity index 100% rename from src/test/ui/unknown-language-item.stderr rename to src/test/ui/lang-item/unknown-language-item.stderr diff --git a/src/test/compile-fail/weak-lang-item.rs b/src/test/ui/lang-item/weak-lang-item.rs similarity index 100% rename from src/test/compile-fail/weak-lang-item.rs rename to src/test/ui/lang-item/weak-lang-item.rs diff --git a/src/test/ui/lang-item/weak-lang-item.stderr b/src/test/ui/lang-item/weak-lang-item.stderr new file mode 100644 index 0000000000000..b7c040c7a850b --- /dev/null +++ b/src/test/ui/lang-item/weak-lang-item.stderr @@ -0,0 +1,19 @@ +error[E0259]: the name `core` is defined multiple times + --> $DIR/weak-lang-item.rs:8:1 + | +LL | extern crate core; + | ^^^^^^^^^^^^^^^^^^ `core` reimported here + | + = note: `core` must be defined only once in the type namespace of this module +help: you can use `as` to change the binding name of the import + | +LL | extern crate core as other_core; + | + +error: `#[panic_handler]` function required, but not found + +error: language item required, but not found: `eh_personality` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0259`. diff --git a/src/test/compile-fail/issue-10755.rs b/src/test/ui/linkage/issue-10755.rs similarity index 100% rename from src/test/compile-fail/issue-10755.rs rename to src/test/ui/linkage/issue-10755.rs diff --git a/src/test/ui/linkage/issue-10755.stderr b/src/test/ui/linkage/issue-10755.stderr new file mode 100644 index 0000000000000..db64944d44ff7 --- /dev/null +++ b/src/test/ui/linkage/issue-10755.stderr @@ -0,0 +1,6 @@ +error: linker `llllll` not found + | + = note: No such file or directory (os error 2) + +error: aborting due to previous error + diff --git a/src/test/ui/fn_must_use.rs b/src/test/ui/lint/fn_must_use.rs similarity index 100% rename from src/test/ui/fn_must_use.rs rename to src/test/ui/lint/fn_must_use.rs diff --git a/src/test/ui/fn_must_use.stderr b/src/test/ui/lint/fn_must_use.stderr similarity index 100% rename from src/test/ui/fn_must_use.stderr rename to src/test/ui/lint/fn_must_use.stderr diff --git a/src/test/compile-fail/must_use-in-stdlib-traits.rs b/src/test/ui/lint/must_use-in-stdlib-traits.rs similarity index 100% rename from src/test/compile-fail/must_use-in-stdlib-traits.rs rename to src/test/ui/lint/must_use-in-stdlib-traits.rs diff --git a/src/test/ui/lint/must_use-in-stdlib-traits.stderr b/src/test/ui/lint/must_use-in-stdlib-traits.stderr new file mode 100644 index 0000000000000..4d5f4b25cb424 --- /dev/null +++ b/src/test/ui/lint/must_use-in-stdlib-traits.stderr @@ -0,0 +1,47 @@ +error: unused implementer of `std::iter::Iterator` that must be used + --> $DIR/must_use-in-stdlib-traits.rs:42:4 + | +LL | iterator(); + | ^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/must_use-in-stdlib-traits.rs:1:9 + | +LL | #![deny(unused_must_use)] + | ^^^^^^^^^^^^^^^ + = note: iterators are lazy and do nothing unless consumed + +error: unused implementer of `std::future::Future` that must be used + --> $DIR/must_use-in-stdlib-traits.rs:43:4 + | +LL | future(); + | ^^^^^^^^^ + | + = note: futures do nothing unless you `.await` or poll them + +error: unused implementer of `std::ops::FnOnce` that must be used + --> $DIR/must_use-in-stdlib-traits.rs:44:4 + | +LL | square_fn_once(); + | ^^^^^^^^^^^^^^^^^ + | + = note: closures are lazy and do nothing unless called + +error: unused implementer of `std::ops::FnMut` that must be used + --> $DIR/must_use-in-stdlib-traits.rs:45:4 + | +LL | square_fn_mut(); + | ^^^^^^^^^^^^^^^^ + | + = note: closures are lazy and do nothing unless called + +error: unused implementer of `std::ops::Fn` that must be used + --> $DIR/must_use-in-stdlib-traits.rs:46:4 + | +LL | square_fn(); + | ^^^^^^^^^^^^ + | + = note: closures are lazy and do nothing unless called + +error: aborting due to 5 previous errors + diff --git a/src/test/ui/meta-expected-error-correct-rev.a.stderr b/src/test/ui/meta-test/meta-expected-error-correct-rev.a.stderr similarity index 100% rename from src/test/ui/meta-expected-error-correct-rev.a.stderr rename to src/test/ui/meta-test/meta-expected-error-correct-rev.a.stderr diff --git a/src/test/ui/meta-expected-error-correct-rev.rs b/src/test/ui/meta-test/meta-expected-error-correct-rev.rs similarity index 100% rename from src/test/ui/meta-expected-error-correct-rev.rs rename to src/test/ui/meta-test/meta-expected-error-correct-rev.rs diff --git a/src/test/ui/meta-test/meta-expected-error-wrong-rev.a.stderr b/src/test/ui/meta-test/meta-expected-error-wrong-rev.a.stderr new file mode 100644 index 0000000000000..72b7285a953ac --- /dev/null +++ b/src/test/ui/meta-test/meta-expected-error-wrong-rev.a.stderr @@ -0,0 +1,13 @@ +error[E0308]: mismatched types + --> $DIR/meta-expected-error-wrong-rev.rs:13:18 + | +LL | let x: u32 = 22_usize; + | ^^^^^^^^ expected u32, found usize +help: change the type of the numeric literal from `usize` to `u32` + | +LL | let x: u32 = 22_u32; + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/meta-expected-error-wrong-rev.rs b/src/test/ui/meta-test/meta-expected-error-wrong-rev.rs similarity index 100% rename from src/test/compile-fail/meta-expected-error-wrong-rev.rs rename to src/test/ui/meta-test/meta-expected-error-wrong-rev.rs diff --git a/src/test/compile-fail/not-utf8.bin b/src/test/ui/not-utf8.bin similarity index 100% rename from src/test/compile-fail/not-utf8.bin rename to src/test/ui/not-utf8.bin diff --git a/src/test/compile-fail/not-utf8.rs b/src/test/ui/not-utf8.rs similarity index 100% rename from src/test/compile-fail/not-utf8.rs rename to src/test/ui/not-utf8.rs diff --git a/src/test/ui/not-utf8.stderr b/src/test/ui/not-utf8.stderr new file mode 100644 index 0000000000000..2f0b6e0a56228 --- /dev/null +++ b/src/test/ui/not-utf8.stderr @@ -0,0 +1,8 @@ +error: couldn't read $DIR/not-utf8.bin: stream did not contain valid UTF-8 + --> $DIR/not-utf8.rs:4:5 + | +LL | include!("not-utf8.bin") + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-handler-missing.rs b/src/test/ui/panic-handler/panic-handler-missing.rs similarity index 100% rename from src/test/compile-fail/panic-handler-missing.rs rename to src/test/ui/panic-handler/panic-handler-missing.rs diff --git a/src/test/ui/panic-handler/panic-handler-missing.stderr b/src/test/ui/panic-handler/panic-handler-missing.stderr new file mode 100644 index 0000000000000..53f7b0336ec77 --- /dev/null +++ b/src/test/ui/panic-handler/panic-handler-missing.stderr @@ -0,0 +1,4 @@ +error: `#[panic_handler]` function required, but not found + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-handler-twice.rs b/src/test/ui/panic-handler/panic-handler-twice.rs similarity index 100% rename from src/test/compile-fail/panic-handler-twice.rs rename to src/test/ui/panic-handler/panic-handler-twice.rs diff --git a/src/test/ui/panic-handler/panic-handler-twice.stderr b/src/test/ui/panic-handler/panic-handler-twice.stderr new file mode 100644 index 0000000000000..10e128495376b --- /dev/null +++ b/src/test/ui/panic-handler/panic-handler-twice.stderr @@ -0,0 +1,14 @@ +error[E0152]: duplicate lang item found: `panic_impl`. + --> $DIR/panic-handler-twice.rs:12:1 + | +LL | / fn panic(info: &PanicInfo) -> ! { +LL | | +LL | | loop {} +LL | | } + | |_^ + | + = note: first defined in crate `some_panic_impl`. + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0152`. diff --git a/src/test/compile-fail/auxiliary/depends.rs b/src/test/ui/panic-runtime/auxiliary/depends.rs similarity index 100% rename from src/test/compile-fail/auxiliary/depends.rs rename to src/test/ui/panic-runtime/auxiliary/depends.rs diff --git a/src/test/compile-fail/auxiliary/needs-panic-runtime.rs b/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs similarity index 100% rename from src/test/compile-fail/auxiliary/needs-panic-runtime.rs rename to src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs diff --git a/src/test/compile-fail/runtime-depend-on-needs-runtime.rs b/src/test/ui/panic-runtime/auxiliary/runtime-depend-on-needs-runtime.rs similarity index 100% rename from src/test/compile-fail/runtime-depend-on-needs-runtime.rs rename to src/test/ui/panic-runtime/auxiliary/runtime-depend-on-needs-runtime.rs diff --git a/src/test/compile-fail/runtime-depend-on-needs-runtime.stderr b/src/test/ui/panic-runtime/auxiliary/runtime-depend-on-needs-runtime.stderr similarity index 100% rename from src/test/compile-fail/runtime-depend-on-needs-runtime.stderr rename to src/test/ui/panic-runtime/auxiliary/runtime-depend-on-needs-runtime.stderr diff --git a/src/test/compile-fail/two-panic-runtimes.rs b/src/test/ui/panic-runtime/auxiliary/two-panic-runtimes.rs similarity index 100% rename from src/test/compile-fail/two-panic-runtimes.rs rename to src/test/ui/panic-runtime/auxiliary/two-panic-runtimes.rs diff --git a/src/test/compile-fail/want-abort-got-unwind.rs b/src/test/ui/panic-runtime/auxiliary/want-abort-got-unwind.rs similarity index 100% rename from src/test/compile-fail/want-abort-got-unwind.rs rename to src/test/ui/panic-runtime/auxiliary/want-abort-got-unwind.rs diff --git a/src/test/compile-fail/want-abort-got-unwind2.rs b/src/test/ui/panic-runtime/auxiliary/want-abort-got-unwind2.rs similarity index 100% rename from src/test/compile-fail/want-abort-got-unwind2.rs rename to src/test/ui/panic-runtime/auxiliary/want-abort-got-unwind2.rs diff --git a/src/test/compile-fail/specialization/issue-50452.rs b/src/test/ui/specialization/issue-50452.rs similarity index 100% rename from src/test/compile-fail/specialization/issue-50452.rs rename to src/test/ui/specialization/issue-50452.rs diff --git a/src/test/ui/specialization/issue-50452.stderr b/src/test/ui/specialization/issue-50452.stderr new file mode 100644 index 0000000000000..5e6f223916798 --- /dev/null +++ b/src/test/ui/specialization/issue-50452.stderr @@ -0,0 +1,16 @@ +error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/issue-50452.rs:11:5 + | +LL | fn foo() {} + | ^^^^^^^^^^^ cannot specialize default item `foo` +... +LL | / impl Foo for T { +LL | | fn foo() {} +LL | | } + | |_- parent `impl` is here + | + = note: to specialize, `foo` in the parent `impl` must be marked `default` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0520`. diff --git a/src/test/ui/issues/issue-17954.rs b/src/test/ui/thread-local/issue-17954.rs similarity index 100% rename from src/test/ui/issues/issue-17954.rs rename to src/test/ui/thread-local/issue-17954.rs diff --git a/src/test/ui/issues/issue-17954.stderr b/src/test/ui/thread-local/issue-17954.stderr similarity index 100% rename from src/test/ui/issues/issue-17954.stderr rename to src/test/ui/thread-local/issue-17954.stderr diff --git a/src/test/ui/thread-local/issue-43733-2-wasm.rs b/src/test/ui/thread-local/issue-43733-2-wasm.rs new file mode 100644 index 0000000000000..69d8762e91862 --- /dev/null +++ b/src/test/ui/thread-local/issue-43733-2-wasm.rs @@ -0,0 +1,30 @@ +// only-wasm32 + +#![feature(cfg_target_thread_local, thread_local_internals)] + +// On platforms *without* `#[thread_local]`, use +// a custom non-`Sync` type to fake the same error. +#[cfg(not(target_thread_local))] +struct Key { + _data: std::cell::UnsafeCell>, + _flag: std::cell::Cell<()>, +} + +#[cfg(not(target_thread_local))] +impl Key { + const fn new() -> Self { + Key { + _data: std::cell::UnsafeCell::new(None), + _flag: std::cell::Cell::new(()), + } + } +} + +#[cfg(target_thread_local)] +use std::thread::__FastLocalKeyInner as Key; + +static __KEY: Key<()> = Key::new(); +//~^ ERROR `std::cell::UnsafeCell>` cannot be shared between threads +//~| ERROR cannot be shared between threads safely [E0277] + +fn main() {} diff --git a/src/test/ui/thread-local/issue-43733-2-wasm.stderr b/src/test/ui/thread-local/issue-43733-2-wasm.stderr new file mode 100644 index 0000000000000..123d3dab9b8f6 --- /dev/null +++ b/src/test/ui/thread-local/issue-43733-2-wasm.stderr @@ -0,0 +1,23 @@ +error[E0277]: `std::cell::UnsafeCell>` cannot be shared between threads safely + --> $DIR/issue-43733-2-wasm.rs:26:1 + | +LL | static __KEY: Key<()> = Key::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell>` cannot be shared between threads safely + | + = help: within `Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell>` + = note: required because it appears within the type `Key<()>` + = note: shared static variables must have a type that implements `Sync` + +error[E0277]: `std::cell::Cell<()>` cannot be shared between threads safely + --> $DIR/issue-43733-2-wasm.rs:26:1 + | +LL | static __KEY: Key<()> = Key::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::Cell<()>` cannot be shared between threads safely + | + = help: within `Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<()>` + = note: required because it appears within the type `Key<()>` + = note: shared static variables must have a type that implements `Sync` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/issue-43733-2.rs b/src/test/ui/thread-local/issue-43733-2.rs similarity index 97% rename from src/test/compile-fail/issue-43733-2.rs rename to src/test/ui/thread-local/issue-43733-2.rs index dae27c4785f15..2ed81da8e9b64 100644 --- a/src/test/compile-fail/issue-43733-2.rs +++ b/src/test/ui/thread-local/issue-43733-2.rs @@ -1,3 +1,5 @@ +// ignore-wasm32 + #![feature(cfg_target_thread_local, thread_local_internals)] // On platforms *without* `#[thread_local]`, use diff --git a/src/test/ui/thread-local/issue-43733-2.stderr b/src/test/ui/thread-local/issue-43733-2.stderr new file mode 100644 index 0000000000000..7d97a9086590c --- /dev/null +++ b/src/test/ui/thread-local/issue-43733-2.stderr @@ -0,0 +1,24 @@ +error[E0277]: `std::cell::Cell` cannot be shared between threads safely + --> $DIR/issue-43733-2.rs:26:1 + | +LL | static __KEY: Key<()> = Key::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::Cell` cannot be shared between threads safely + | + = help: within `std::thread::__FastLocalKeyInner<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell` + = note: required because it appears within the type `std::thread::__FastLocalKeyInner<()>` + = note: shared static variables must have a type that implements `Sync` + +error[E0277]: `std::cell::UnsafeCell>` cannot be shared between threads safely + --> $DIR/issue-43733-2.rs:26:1 + | +LL | static __KEY: Key<()> = Key::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell>` cannot be shared between threads safely + | + = help: within `std::thread::__FastLocalKeyInner<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell>` + = note: required because it appears within the type `std::thread::local::lazy::LazyKeyInner<()>` + = note: required because it appears within the type `std::thread::__FastLocalKeyInner<()>` + = note: shared static variables must have a type that implements `Sync` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issues/issue-43733.rs b/src/test/ui/thread-local/issue-43733.rs similarity index 100% rename from src/test/ui/issues/issue-43733.rs rename to src/test/ui/thread-local/issue-43733.rs diff --git a/src/test/ui/issues/issue-43733.stderr b/src/test/ui/thread-local/issue-43733.stderr similarity index 100% rename from src/test/ui/issues/issue-43733.stderr rename to src/test/ui/thread-local/issue-43733.stderr diff --git a/src/test/ui/thread-local-in-ctfe.nll.stderr b/src/test/ui/thread-local/thread-local-in-ctfe.nll.stderr similarity index 100% rename from src/test/ui/thread-local-in-ctfe.nll.stderr rename to src/test/ui/thread-local/thread-local-in-ctfe.nll.stderr diff --git a/src/test/ui/thread-local-in-ctfe.rs b/src/test/ui/thread-local/thread-local-in-ctfe.rs similarity index 100% rename from src/test/ui/thread-local-in-ctfe.rs rename to src/test/ui/thread-local/thread-local-in-ctfe.rs diff --git a/src/test/ui/thread-local-in-ctfe.stderr b/src/test/ui/thread-local/thread-local-in-ctfe.stderr similarity index 100% rename from src/test/ui/thread-local-in-ctfe.stderr rename to src/test/ui/thread-local/thread-local-in-ctfe.stderr diff --git a/src/test/ui/thread-local-mutation.rs b/src/test/ui/thread-local/thread-local-mutation.rs similarity index 100% rename from src/test/ui/thread-local-mutation.rs rename to src/test/ui/thread-local/thread-local-mutation.rs diff --git a/src/test/ui/thread-local-mutation.stderr b/src/test/ui/thread-local/thread-local-mutation.stderr similarity index 100% rename from src/test/ui/thread-local-mutation.stderr rename to src/test/ui/thread-local/thread-local-mutation.stderr