From 9723ed00f666c48eb4a7026f28456ed8aa87abed Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 25 Jun 2019 11:17:22 +0200 Subject: [PATCH 1/2] Move tests in src/test/compile-fail -> src/test/ui. --- .../auxiliary/panic-runtime-lang-items.rs | 15 ----- .../auxiliary/panic-runtime-unwind.rs | 17 ------ .../auxiliary/panic-runtime-unwind2.rs | 17 ------ .../compile-fail/auxiliary/some-panic-impl.rs | 11 ---- .../auxiliary/wants-panic-runtime-unwind.rs | 6 -- .../asm}/asm-src-loc-codegen-units.rs | 0 .../{compile-fail => ui/asm}/asm-src-loc.rs | 0 src/test/ui/asm/asm-src-loc.stderr | 11 ++++ .../associated-types}/issue-23595-1.rs | 0 .../ui/associated-types/issue-23595-1.stderr | 18 ++++++ .../chalkify/chalk_initial_program.rs | 0 .../ui/chalkify/chalk_initial_program.stderr | 15 +++++ .../chalkify/generic_impls.rs | 0 src/test/ui/chalkify/generic_impls.stderr | 31 ++++++++++ .../{compile-fail => ui}/chalkify/impl_wf.rs | 0 src/test/ui/chalkify/impl_wf.stderr | 35 +++++++++++ .../recursive_where_clause_on_type.rs | 0 .../recursive_where_clause_on_type.stderr | 14 +++++ .../{compile-fail => ui}/chalkify/type_wf.rs | 0 src/test/ui/chalkify/type_wf.stderr | 18 ++++++ .../coerce-unsafe-closure-to-unsafe-fn-ptr.rs | 0 ...rce-unsafe-closure-to-unsafe-fn-ptr.stderr | 11 ++++ .../coercion}/coerce-unsafe-to-closure.rs | 0 .../coercion/coerce-unsafe-to-closure.stderr | 11 ++++ .../{compile-fail => ui/consts}/const-err3.rs | 0 src/test/ui/consts/const-err3.stderr | 32 ++++++++++ .../consts}/const-fn-error.rs | 0 src/test/ui/consts/const-fn-error.stderr | 34 +++++++++++ .../consts}/issue-52443.rs | 0 src/test/ui/consts/issue-52443.stderr | 55 ++++++++++++++++++ .../auxiliary/crateresolve1-1.rs | 0 .../auxiliary/crateresolve1-2.rs | 0 .../auxiliary/crateresolve1-3.rs | 0 .../crateresolve1}/crateresolve1.rs | 0 .../ui/crateresolve1/crateresolve1.stderr | 20 +++++++ ...sue-46209-private-enum-variant-reexport.rs | 0 ...46209-private-enum-variant-reexport.stderr | 44 ++++++++++++++ .../imports}/empty-extern-arg.rs | 0 src/test/ui/imports/empty-extern-arg.stderr | 7 +++ .../lang-item}/auxiliary/weak-lang-items.rs | 0 .../ui/{ => lang-item}/lang-item-missing.rs | 0 .../{ => lang-item}/lang-item-missing.stderr | 0 .../ui/{ => lang-item}/required-lang-item.rs | 0 .../{ => lang-item}/required-lang-item.stderr | 0 .../{ => lang-item}/unknown-language-item.rs | 0 .../unknown-language-item.stderr | 0 .../lang-item}/weak-lang-item.rs | 0 src/test/ui/lang-item/weak-lang-item.stderr | 19 ++++++ .../linkage}/invalid-link-args.rs | 0 src/test/ui/linkage/invalid-link-args.stderr | 9 +++ .../linkage}/issue-10755.rs | 0 src/test/ui/linkage/issue-10755.stderr | 6 ++ src/test/ui/{ => lint}/fn_must_use.rs | 0 src/test/ui/{ => lint}/fn_must_use.stderr | 0 .../lint}/must_use-in-stdlib-traits.rs | 0 .../ui/lint/must_use-in-stdlib-traits.stderr | 47 +++++++++++++++ .../meta-expected-error-correct-rev.a.stderr | 0 .../meta-expected-error-correct-rev.rs | 0 .../meta-expected-error-wrong-rev.a.stderr | 13 +++++ .../meta-expected-error-wrong-rev.rs | 0 src/test/{compile-fail => ui}/not-utf8.bin | Bin src/test/{compile-fail => ui}/not-utf8.rs | 0 src/test/ui/not-utf8.stderr | 8 +++ .../panic-handler}/panic-handler-missing.rs | 0 .../panic-handler-missing.stderr | 4 ++ .../panic-handler}/panic-handler-twice.rs | 0 .../panic-handler/panic-handler-twice.stderr | 14 +++++ .../panic-runtime}/auxiliary/depends.rs | 0 .../auxiliary/needs-panic-runtime.rs | 0 .../runtime-depend-on-needs-runtime.rs | 0 .../runtime-depend-on-needs-runtime.stderr | 0 .../auxiliary}/two-panic-runtimes.rs | 0 .../auxiliary}/want-abort-got-unwind.rs | 0 .../auxiliary}/want-abort-got-unwind2.rs | 0 .../specialization/issue-50452.rs | 0 src/test/ui/specialization/issue-50452.stderr | 16 +++++ .../{issues => thread-local}/issue-17954.rs | 0 .../issue-17954.stderr | 0 .../thread-local}/issue-43733-2.rs | 0 src/test/ui/thread-local/issue-43733-2.stderr | 24 ++++++++ .../{issues => thread-local}/issue-43733.rs | 0 .../issue-43733.stderr | 0 .../thread-local-in-ctfe.nll.stderr | 0 .../thread-local-in-ctfe.rs | 0 .../thread-local-in-ctfe.stderr | 0 .../thread-local-mutation.rs | 0 .../thread-local-mutation.stderr | 0 87 files changed, 516 insertions(+), 66 deletions(-) delete mode 100644 src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs delete mode 100644 src/test/compile-fail/auxiliary/panic-runtime-unwind.rs delete mode 100644 src/test/compile-fail/auxiliary/panic-runtime-unwind2.rs delete mode 100644 src/test/compile-fail/auxiliary/some-panic-impl.rs delete mode 100644 src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs rename src/test/{compile-fail => ui/asm}/asm-src-loc-codegen-units.rs (100%) rename src/test/{compile-fail => ui/asm}/asm-src-loc.rs (100%) create mode 100644 src/test/ui/asm/asm-src-loc.stderr rename src/test/{compile-fail => ui/associated-types}/issue-23595-1.rs (100%) create mode 100644 src/test/ui/associated-types/issue-23595-1.stderr rename src/test/{compile-fail => ui}/chalkify/chalk_initial_program.rs (100%) create mode 100644 src/test/ui/chalkify/chalk_initial_program.stderr rename src/test/{compile-fail => ui}/chalkify/generic_impls.rs (100%) create mode 100644 src/test/ui/chalkify/generic_impls.stderr rename src/test/{compile-fail => ui}/chalkify/impl_wf.rs (100%) create mode 100644 src/test/ui/chalkify/impl_wf.stderr rename src/test/{compile-fail => ui}/chalkify/recursive_where_clause_on_type.rs (100%) create mode 100644 src/test/ui/chalkify/recursive_where_clause_on_type.stderr rename src/test/{compile-fail => ui}/chalkify/type_wf.rs (100%) create mode 100644 src/test/ui/chalkify/type_wf.stderr rename src/test/{compile-fail => ui/coercion}/coerce-unsafe-closure-to-unsafe-fn-ptr.rs (100%) create mode 100644 src/test/ui/coercion/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr rename src/test/{compile-fail => ui/coercion}/coerce-unsafe-to-closure.rs (100%) create mode 100644 src/test/ui/coercion/coerce-unsafe-to-closure.stderr rename src/test/{compile-fail => ui/consts}/const-err3.rs (100%) create mode 100644 src/test/ui/consts/const-err3.stderr rename src/test/{compile-fail => ui/consts}/const-fn-error.rs (100%) create mode 100644 src/test/ui/consts/const-fn-error.stderr rename src/test/{compile-fail => ui/consts}/issue-52443.rs (100%) create mode 100644 src/test/ui/consts/issue-52443.stderr rename src/test/{compile-fail => ui/crateresolve1}/auxiliary/crateresolve1-1.rs (100%) rename src/test/{compile-fail => ui/crateresolve1}/auxiliary/crateresolve1-2.rs (100%) rename src/test/{compile-fail => ui/crateresolve1}/auxiliary/crateresolve1-3.rs (100%) rename src/test/{compile-fail => ui/crateresolve1}/crateresolve1.rs (100%) create mode 100644 src/test/ui/crateresolve1/crateresolve1.stderr rename src/test/{compile-fail => ui/enum}/issue-46209-private-enum-variant-reexport.rs (100%) create mode 100644 src/test/ui/enum/issue-46209-private-enum-variant-reexport.stderr rename src/test/{compile-fail => ui/imports}/empty-extern-arg.rs (100%) create mode 100644 src/test/ui/imports/empty-extern-arg.stderr rename src/test/{compile-fail => ui/lang-item}/auxiliary/weak-lang-items.rs (100%) rename src/test/ui/{ => lang-item}/lang-item-missing.rs (100%) rename src/test/ui/{ => lang-item}/lang-item-missing.stderr (100%) rename src/test/ui/{ => lang-item}/required-lang-item.rs (100%) rename src/test/ui/{ => lang-item}/required-lang-item.stderr (100%) rename src/test/ui/{ => lang-item}/unknown-language-item.rs (100%) rename src/test/ui/{ => lang-item}/unknown-language-item.stderr (100%) rename src/test/{compile-fail => ui/lang-item}/weak-lang-item.rs (100%) create mode 100644 src/test/ui/lang-item/weak-lang-item.stderr rename src/test/{compile-fail => ui/linkage}/invalid-link-args.rs (100%) create mode 100644 src/test/ui/linkage/invalid-link-args.stderr rename src/test/{compile-fail => ui/linkage}/issue-10755.rs (100%) create mode 100644 src/test/ui/linkage/issue-10755.stderr rename src/test/ui/{ => lint}/fn_must_use.rs (100%) rename src/test/ui/{ => lint}/fn_must_use.stderr (100%) rename src/test/{compile-fail => ui/lint}/must_use-in-stdlib-traits.rs (100%) create mode 100644 src/test/ui/lint/must_use-in-stdlib-traits.stderr rename src/test/ui/{ => meta-test}/meta-expected-error-correct-rev.a.stderr (100%) rename src/test/ui/{ => meta-test}/meta-expected-error-correct-rev.rs (100%) create mode 100644 src/test/ui/meta-test/meta-expected-error-wrong-rev.a.stderr rename src/test/{compile-fail => ui/meta-test}/meta-expected-error-wrong-rev.rs (100%) rename src/test/{compile-fail => ui}/not-utf8.bin (100%) rename src/test/{compile-fail => ui}/not-utf8.rs (100%) create mode 100644 src/test/ui/not-utf8.stderr rename src/test/{compile-fail => ui/panic-handler}/panic-handler-missing.rs (100%) create mode 100644 src/test/ui/panic-handler/panic-handler-missing.stderr rename src/test/{compile-fail => ui/panic-handler}/panic-handler-twice.rs (100%) create mode 100644 src/test/ui/panic-handler/panic-handler-twice.stderr rename src/test/{compile-fail => ui/panic-runtime}/auxiliary/depends.rs (100%) rename src/test/{compile-fail => ui/panic-runtime}/auxiliary/needs-panic-runtime.rs (100%) rename src/test/{compile-fail => ui/panic-runtime/auxiliary}/runtime-depend-on-needs-runtime.rs (100%) rename src/test/{compile-fail => ui/panic-runtime/auxiliary}/runtime-depend-on-needs-runtime.stderr (100%) rename src/test/{compile-fail => ui/panic-runtime/auxiliary}/two-panic-runtimes.rs (100%) rename src/test/{compile-fail => ui/panic-runtime/auxiliary}/want-abort-got-unwind.rs (100%) rename src/test/{compile-fail => ui/panic-runtime/auxiliary}/want-abort-got-unwind2.rs (100%) rename src/test/{compile-fail => ui}/specialization/issue-50452.rs (100%) create mode 100644 src/test/ui/specialization/issue-50452.stderr rename src/test/ui/{issues => thread-local}/issue-17954.rs (100%) rename src/test/ui/{issues => thread-local}/issue-17954.stderr (100%) rename src/test/{compile-fail => ui/thread-local}/issue-43733-2.rs (100%) create mode 100644 src/test/ui/thread-local/issue-43733-2.stderr rename src/test/ui/{issues => thread-local}/issue-43733.rs (100%) rename src/test/ui/{issues => thread-local}/issue-43733.stderr (100%) rename src/test/ui/{ => thread-local}/thread-local-in-ctfe.nll.stderr (100%) rename src/test/ui/{ => thread-local}/thread-local-in-ctfe.rs (100%) rename src/test/ui/{ => thread-local}/thread-local-in-ctfe.stderr (100%) rename src/test/ui/{ => thread-local}/thread-local-mutation.rs (100%) rename src/test/ui/{ => thread-local}/thread-local-mutation.stderr (100%) 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-codegen-units.rs b/src/test/ui/asm/asm-src-loc-codegen-units.rs similarity index 100% rename from src/test/compile-fail/asm-src-loc-codegen-units.rs rename to src/test/ui/asm/asm-src-loc-codegen-units.rs 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/impl_wf.rs b/src/test/ui/chalkify/impl_wf.rs similarity index 100% rename from src/test/compile-fail/chalkify/impl_wf.rs rename to src/test/ui/chalkify/impl_wf.rs diff --git a/src/test/ui/chalkify/impl_wf.stderr b/src/test/ui/chalkify/impl_wf.stderr new file mode 100644 index 0000000000000..00f590cd959fd --- /dev/null +++ b/src/test/ui/chalkify/impl_wf.stderr @@ -0,0 +1,35 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/impl_wf.rs:11:6 + | +LL | impl Foo for str { } + | ^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit +note: required by `Foo` + --> $DIR/impl_wf.rs:3:1 + | +LL | trait Foo: Sized { } + | ^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `f32: Foo` is not satisfied + --> $DIR/impl_wf.rs:25:6 + | +LL | impl Bar for f32 { + | ^^^ the trait `Foo` is not implemented for `f32` + +error[E0277]: the trait bound `f32: Foo` is not satisfied + --> $DIR/impl_wf.rs:34:6 + | +LL | impl Baz for f32 { } + | ^^^^^^^^ the trait `Foo` is not implemented for `f32` + | +note: required by `Baz` + --> $DIR/impl_wf.rs:30:1 + | +LL | trait Baz where U: Foo { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/chalkify/recursive_where_clause_on_type.rs b/src/test/ui/chalkify/recursive_where_clause_on_type.rs similarity index 100% rename from src/test/compile-fail/chalkify/recursive_where_clause_on_type.rs rename to src/test/ui/chalkify/recursive_where_clause_on_type.rs diff --git a/src/test/ui/chalkify/recursive_where_clause_on_type.stderr b/src/test/ui/chalkify/recursive_where_clause_on_type.stderr new file mode 100644 index 0000000000000..113e3ac1e426b --- /dev/null +++ b/src/test/ui/chalkify/recursive_where_clause_on_type.stderr @@ -0,0 +1,14 @@ +error: the type `S` is not well-formed (chalk) + --> $DIR/recursive_where_clause_on_type.rs:26:5 + | +LL | foo::() + | ^^^^^^^^ + +error: the type `S` is not well-formed (chalk) + --> $DIR/recursive_where_clause_on_type.rs:26:11 + | +LL | foo::() + | ^ + +error: aborting due to 2 previous errors + 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/coerce-unsafe-to-closure.rs b/src/test/ui/coercion/coerce-unsafe-to-closure.rs similarity index 100% rename from src/test/compile-fail/coerce-unsafe-to-closure.rs rename to src/test/ui/coercion/coerce-unsafe-to-closure.rs diff --git a/src/test/ui/coercion/coerce-unsafe-to-closure.stderr b/src/test/ui/coercion/coerce-unsafe-to-closure.stderr new file mode 100644 index 0000000000000..cd52550d47892 --- /dev/null +++ b/src/test/ui/coercion/coerce-unsafe-to-closure.stderr @@ -0,0 +1,11 @@ +error[E0277]: expected a `std::ops::FnOnce<(&str,)>` closure, found `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` + --> $DIR/coerce-unsafe-to-closure.rs:2:40 + | +LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); + | ^^^ expected an `FnOnce<(&str,)>` closure, found `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` + | + = help: the trait `std::ops::FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. 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/compile-fail/auxiliary/crateresolve1-1.rs b/src/test/ui/crateresolve1/auxiliary/crateresolve1-1.rs similarity index 100% rename from src/test/compile-fail/auxiliary/crateresolve1-1.rs rename to src/test/ui/crateresolve1/auxiliary/crateresolve1-1.rs diff --git a/src/test/compile-fail/auxiliary/crateresolve1-2.rs b/src/test/ui/crateresolve1/auxiliary/crateresolve1-2.rs similarity index 100% rename from src/test/compile-fail/auxiliary/crateresolve1-2.rs rename to src/test/ui/crateresolve1/auxiliary/crateresolve1-2.rs diff --git a/src/test/compile-fail/auxiliary/crateresolve1-3.rs b/src/test/ui/crateresolve1/auxiliary/crateresolve1-3.rs similarity index 100% rename from src/test/compile-fail/auxiliary/crateresolve1-3.rs rename to src/test/ui/crateresolve1/auxiliary/crateresolve1-3.rs diff --git a/src/test/compile-fail/crateresolve1.rs b/src/test/ui/crateresolve1/crateresolve1.rs similarity index 100% rename from src/test/compile-fail/crateresolve1.rs rename to src/test/ui/crateresolve1/crateresolve1.rs diff --git a/src/test/ui/crateresolve1/crateresolve1.stderr b/src/test/ui/crateresolve1/crateresolve1.stderr new file mode 100644 index 0000000000000..d8854538ff30b --- /dev/null +++ b/src/test/ui/crateresolve1/crateresolve1.stderr @@ -0,0 +1,20 @@ +error[E0464]: multiple matching crates for `crateresolve1` + --> $DIR/crateresolve1.rs:6:1 + | +LL | extern crate crateresolve1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: candidates: + crate `crateresolve1`: $TEST_BUILD_DIR/crateresolve1/crateresolve1/auxiliary/libcrateresolve1-3.so + crate `crateresolve1`: $TEST_BUILD_DIR/crateresolve1/crateresolve1/auxiliary/libcrateresolve1-1.so + crate `crateresolve1`: $TEST_BUILD_DIR/crateresolve1/crateresolve1/auxiliary/libcrateresolve1-2.so + +error[E0463]: can't find crate for `crateresolve1` + --> $DIR/crateresolve1.rs:6:1 + | +LL | extern crate crateresolve1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs b/src/test/ui/enum/issue-46209-private-enum-variant-reexport.rs similarity index 100% rename from src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs rename to src/test/ui/enum/issue-46209-private-enum-variant-reexport.rs diff --git a/src/test/ui/enum/issue-46209-private-enum-variant-reexport.stderr b/src/test/ui/enum/issue-46209-private-enum-variant-reexport.stderr new file mode 100644 index 0000000000000..28cb2f16c1a0d --- /dev/null +++ b/src/test/ui/enum/issue-46209-private-enum-variant-reexport.stderr @@ -0,0 +1,44 @@ +error: enum is private and its variants cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:9:13 + | +LL | pub use self::PettyOfficer::*; + | ^^^^^^^^^^^^^^^^^^^^^ +... +LL | pub(in rank) enum PettyOfficer { + | ------------------------------ help: consider making the enum public: `pub enum PettyOfficer` + +error: enum is private and its variants cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:4:13 + | +LL | pub use self::Professor::*; + | ^^^^^^^^^^^^^^^^^^ +... +LL | enum Professor { + | -------------- help: consider making the enum public: `pub enum Professor` + +error: variant `Full` is private and cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:6:45 + | +LL | pub use self::Lieutenant::{JuniorGrade, Full}; + | ^^^^ +... +LL | enum Lieutenant { + | --------------- help: consider making the enum public: `pub enum Lieutenant` + +error: variant `JuniorGrade` is private and cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:6:32 + | +LL | pub use self::Lieutenant::{JuniorGrade, Full}; + | ^^^^^^^^^^^ + +error: enum is private and its variants cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:11:13 + | +LL | pub use self::Crewman::*; + | ^^^^^^^^^^^^^^^^ +... +LL | crate enum Crewman { + | ------------------ help: consider making the enum public: `pub enum Crewman` + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/empty-extern-arg.rs b/src/test/ui/imports/empty-extern-arg.rs similarity index 100% rename from src/test/compile-fail/empty-extern-arg.rs rename to src/test/ui/imports/empty-extern-arg.rs 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/invalid-link-args.rs b/src/test/ui/linkage/invalid-link-args.rs similarity index 100% rename from src/test/compile-fail/invalid-link-args.rs rename to src/test/ui/linkage/invalid-link-args.rs diff --git a/src/test/ui/linkage/invalid-link-args.stderr b/src/test/ui/linkage/invalid-link-args.stderr new file mode 100644 index 0000000000000..b15240c52f37d --- /dev/null +++ b/src/test/ui/linkage/invalid-link-args.stderr @@ -0,0 +1,9 @@ +error: linking with `ld` failed: exit code: 1 + | + = note: "ld" "-L" "$BUILD_DIR/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "$TEST_BUILD_DIR/linkage/invalid-link-args/invalid-link-args.invalid_link_args.7rcbfp3g-cgu.0.rcgu.o" "$TEST_BUILD_DIR/linkage/invalid-link-args/invalid-link-args.invalid_link_args.7rcbfp3g-cgu.1.rcgu.o" "-o" "$TEST_BUILD_DIR/linkage/invalid-link-args/invalid-link-args" "--gc-sections" "-pie" "-zrelro" "-znow" "-O1" "-L" "$BUILD_DIR/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "$TEST_BUILD_DIR/linkage/invalid-link-args/auxiliary" "-L" "$BUILD_DIR/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--start-group" "-L" "$BUILD_DIR/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lstd-df58114e777eef4d" "--end-group" "-Bstatic" "$BUILD_DIR/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-34e2d1be8ef7ab6e.rlib" "-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-Wl,-rpath,$ORIGIN/../../../../stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-rpath,$LIB_DIR/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--enable-new-dtags" "aFdEfSeVEEE" + = note: ld: unrecognised option '-Wl,-rpath,$ORIGIN/../../../../stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib' + ld: use the --help option for usage information + + +error: aborting due to previous error + 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/compile-fail/issue-43733-2.rs b/src/test/ui/thread-local/issue-43733-2.rs similarity index 100% rename from src/test/compile-fail/issue-43733-2.rs rename to src/test/ui/thread-local/issue-43733-2.rs 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..ae8ccf1e9f1a1 --- /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:24: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:24: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 From 3282050c756a11c55d464c9ed97353dd10993557 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 25 Jun 2019 11:17:51 +0200 Subject: [PATCH 2/2] bye bye src/test/compile-fail. --- src/bootstrap/README.md | 1 - src/bootstrap/builder.rs | 1 - src/bootstrap/test.rs | 6 ------ src/tools/compiletest/src/common.rs | 5 +---- src/tools/compiletest/src/main.rs | 2 +- src/tools/compiletest/src/runtest.rs | 17 +++++++---------- 6 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/bootstrap/README.md b/src/bootstrap/README.md index 1e01d68fb3a61..3d38329c8ffae 100644 --- a/src/bootstrap/README.md +++ b/src/bootstrap/README.md @@ -216,7 +216,6 @@ build/ # Output for all compiletest-based test suites test/ run-pass/ - compile-fail/ debuginfo/ ... diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 2e9df48d00002..6ffb7d58340a8 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -372,7 +372,6 @@ impl<'a> Builder<'a> { test::Tidy, test::Ui, test::RunPass, - test::CompileFail, test::RunFail, test::RunPassValgrind, test::MirOpt, diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 2f9bd067c3115..9b2e95f264d93 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -828,12 +828,6 @@ default_test_with_compare_mode!(RunPass { compare_mode: "nll" }); -default_test!(CompileFail { - path: "src/test/compile-fail", - mode: "compile-fail", - suite: "compile-fail" -}); - default_test!(RunFail { path: "src/test/run-fail", mode: "run-fail", diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 722979c3c1402..6b24651898d8c 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -10,7 +10,6 @@ use crate::util::PathBufExt; #[derive(Clone, Copy, PartialEq, Debug)] pub enum Mode { - CompileFail, RunFail, /// This now behaves like a `ui` test that has an implict `// run-pass`. RunPass, @@ -50,7 +49,6 @@ impl FromStr for Mode { type Err = (); fn from_str(s: &str) -> Result { match s { - "compile-fail" => Ok(CompileFail), "run-fail" => Ok(RunFail), "run-pass" => Ok(RunPass), "run-pass-valgrind" => Ok(RunPassValgrind), @@ -76,7 +74,6 @@ impl FromStr for Mode { impl fmt::Display for Mode { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let s = match *self { - CompileFail => "compile-fail", RunFail => "run-fail", RunPass => "run-pass", RunPassValgrind => "run-pass-valgrind", @@ -172,7 +169,7 @@ pub struct Config { /// The name of the stage being built (stage1, etc) pub stage_id: String, - /// The test mode, compile-fail, run-fail, run-pass + /// The test mode, run-fail, run-pass pub mode: Mode, /// Run ignored tests diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index d0dc9d11d3963..dc9ade024c1e7 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -125,7 +125,7 @@ pub fn parse_config(args: Vec) -> Config { "", "mode", "which sort of compile tests to run", - "(compile-fail|run-fail|run-pass|\ + "(run-fail|run-pass|\ run-pass-valgrind|pretty|debug-info|incremental|mir-opt)", ) .optflag("", "ignored", "run tests marked as ignored") diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 8b52a529d440a..8474d9593fca5 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -5,7 +5,7 @@ use crate::common::{expected_output_path, UI_EXTENSIONS, UI_FIXED, UI_STDERR, UI use crate::common::{output_base_dir, output_base_name, output_testname_unique}; use crate::common::{Codegen, CodegenUnits, Rustdoc}; use crate::common::{DebugInfoCdb, DebugInfoGdbLldb, DebugInfoGdb, DebugInfoLldb}; -use crate::common::{CompileFail, Pretty, RunFail, RunPass, RunPassValgrind}; +use crate::common::{Pretty, RunFail, RunPass, RunPassValgrind}; use crate::common::{Config, TestPaths}; use crate::common::{Incremental, MirOpt, RunMake, Ui, JsDocTest, Assembly}; use diff; @@ -286,7 +286,6 @@ impl<'test> TestCx<'test> { /// revisions, exactly once, with revision == None). fn run_revision(&self) { match self.config.mode { - CompileFail => self.run_cfail_test(), RunFail => self.run_rfail_test(), RunPassValgrind => self.run_valgrind_test(), Pretty => self.run_pretty_test(), @@ -319,7 +318,6 @@ impl<'test> TestCx<'test> { fn should_compile_successfully(&self) -> bool { match self.config.mode { - CompileFail => false, RunPass => true, JsDocTest => true, Ui => self.props.pass_mode.is_some(), @@ -1535,12 +1533,11 @@ impl<'test> TestCx<'test> { rustc.arg("-L").arg(&self.aux_output_dir_name()); match self.config.mode { - CompileFail | Ui => { - // compile-fail and ui tests tend to have tons of unused code as - // it's just testing various pieces of the compile, but we don't - // want to actually assert warnings about all this code. Instead - // let's just ignore unused code warnings by defaults and tests - // can turn it back on if needed. + Ui => { + // ui tests tend to have tons of unused code as it's just testing + // various pieces of the compile, but we don't want to actually assert + // warnings about all this code. Instead let's just ignore unused + // code warnings by defaults and tests can turn it back on if needed. if !self.config.src_base.ends_with("rustdoc-ui") { rustc.args(&["-A", "unused"]); } @@ -1922,7 +1919,7 @@ impl<'test> TestCx<'test> { } match self.config.mode { - CompileFail | Incremental => { + Incremental => { // If we are extracting and matching errors in the new // fashion, then you want JSON mode. Old-skool error // patterns still match the raw compiler output.