diff --git a/tests/ui/issues/issue-33461.rs b/tests/ui/associated-types/self-type-projection-dyn-coerce.rs similarity index 73% rename from tests/ui/issues/issue-33461.rs rename to tests/ui/associated-types/self-type-projection-dyn-coerce.rs index 0de05c6687afb..81353e781d090 100644 --- a/tests/ui/issues/issue-33461.rs +++ b/tests/ui/associated-types/self-type-projection-dyn-coerce.rs @@ -1,4 +1,8 @@ +//! Regression test for . +//! This used to ICE as coercion to trait object didn't normalize associated +//! type. //@ run-pass + #![allow(unused_variables)] use std::marker::PhantomData; diff --git a/tests/ui/issues/issue-29857.rs b/tests/ui/coherence/error-type-coherence-no-ice.rs similarity index 71% rename from tests/ui/issues/issue-29857.rs rename to tests/ui/coherence/error-type-coherence-no-ice.rs index 9d4c9b2935a28..c66a02aa6cd27 100644 --- a/tests/ui/issues/issue-29857.rs +++ b/tests/ui/coherence/error-type-coherence-no-ice.rs @@ -1,3 +1,5 @@ +//! Regression test for . +//! This used to ICE during coherence on Error types. //@ check-pass use std::marker::PhantomData; diff --git a/tests/ui/drop/drop-value-by-method.rs b/tests/ui/drop/drop-value-by-method.rs new file mode 100644 index 0000000000000..78c22d30e72b5 --- /dev/null +++ b/tests/ui/drop/drop-value-by-method.rs @@ -0,0 +1,31 @@ +//! Regression test for . +//! Initially a pretty-printer bug, which omitted parentheses around `move` +//! keyword in lhs (`(move z).f()`), now this behaviour is untestable as +//! plain `move` outside a closure doesn't exist. +//! +//! Now appears to test that drop works correctly when value is moved by method. +//@ run-pass + +#![allow(dead_code)] +#![allow(non_camel_case_types)] + +struct thing { x: isize, } + +impl Drop for thing { + fn drop(&mut self) {} +} + +fn thing() -> thing { + thing { + x: 0 + } +} + +impl thing { + pub fn f(self) {} +} + +pub fn main() { + let z = thing(); + (z).f(); +} diff --git a/tests/ui/issues/issue-30380.rs b/tests/ui/drop/panic-in-drop-during-assignment.rs similarity index 77% rename from tests/ui/issues/issue-30380.rs rename to tests/ui/drop/panic-in-drop-during-assignment.rs index 49fce3d150cd7..d13bc022e7c8f 100644 --- a/tests/ui/issues/issue-30380.rs +++ b/tests/ui/drop/panic-in-drop-during-assignment.rs @@ -1,5 +1,6 @@ -// check that panics in destructors during assignment do not leave -// destroyed values lying around for other destructors to observe. +//! Regression test for . +//! Check that panics in destructors during assignment do not leave +//! destroyed values lying around for other destructors to observe. //@ run-fail //@ error-pattern:panicking destructors ftw! diff --git a/tests/ui/issues/issue-33241.rs b/tests/ui/dst/unsized-tuple-trait-tail.rs similarity index 58% rename from tests/ui/issues/issue-33241.rs rename to tests/ui/dst/unsized-tuple-trait-tail.rs index 1c497876a90da..1fc66b8a866b9 100644 --- a/tests/ui/issues/issue-33241.rs +++ b/tests/ui/dst/unsized-tuple-trait-tail.rs @@ -1,3 +1,6 @@ +//! Regression test for . +//! This used to fire LLVM assertion, and later on ICE because of +//! `t` type size incosistency between LLVM and rustc. //@ check-pass use std::fmt; diff --git a/tests/ui/issues/issue-3220.rs b/tests/ui/issues/issue-3220.rs deleted file mode 100644 index 2f5ca82b2fac3..0000000000000 --- a/tests/ui/issues/issue-3220.rs +++ /dev/null @@ -1,24 +0,0 @@ -//@ run-pass -#![allow(dead_code)] -#![allow(non_camel_case_types)] - -struct thing { x: isize, } - -impl Drop for thing { - fn drop(&mut self) {} -} - -fn thing() -> thing { - thing { - x: 0 - } -} - -impl thing { - pub fn f(self) {} -} - -pub fn main() { - let z = thing(); - (z).f(); -} diff --git a/tests/ui/issues/issue-30255.rs b/tests/ui/lifetimes/lifetime-errors/elision-error-omits-lifetimeless-params.rs similarity index 67% rename from tests/ui/issues/issue-30255.rs rename to tests/ui/lifetimes/lifetime-errors/elision-error-omits-lifetimeless-params.rs index 6970a122b7144..246082f54f08e 100644 --- a/tests/ui/issues/issue-30255.rs +++ b/tests/ui/lifetimes/lifetime-errors/elision-error-omits-lifetimeless-params.rs @@ -1,6 +1,6 @@ -// -// Test that lifetime elision error messages correctly omit parameters -// with no elided lifetimes +//! Regression test for . +//! Test that lifetime elision error messages correctly omit parameters +//! with no elided lifetimes. struct S<'a> { field: &'a i32, diff --git a/tests/ui/issues/issue-30255.stderr b/tests/ui/lifetimes/lifetime-errors/elision-error-omits-lifetimeless-params.stderr similarity index 90% rename from tests/ui/issues/issue-30255.stderr rename to tests/ui/lifetimes/lifetime-errors/elision-error-omits-lifetimeless-params.stderr index adb721a1cbaf1..fbabc9a56074b 100644 --- a/tests/ui/issues/issue-30255.stderr +++ b/tests/ui/lifetimes/lifetime-errors/elision-error-omits-lifetimeless-params.stderr @@ -1,5 +1,5 @@ error[E0106]: missing lifetime specifier - --> $DIR/issue-30255.rs:9:24 + --> $DIR/elision-error-omits-lifetimeless-params.rs:9:24 | LL | fn f(a: &S, b: i32) -> &i32 { | -- ^ expected named lifetime parameter @@ -11,7 +11,7 @@ LL | fn f<'a>(a: &'a S<'a>, b: i32) -> &'a i32 { | ++++ ++ ++++ ++ error[E0106]: missing lifetime specifier - --> $DIR/issue-30255.rs:14:34 + --> $DIR/elision-error-omits-lifetimeless-params.rs:14:34 | LL | fn g(a: &S, b: bool, c: &i32) -> &i32 { | -- ---- ^ expected named lifetime parameter @@ -23,7 +23,7 @@ LL | fn g<'a>(a: &'a S<'a>, b: bool, c: &'a i32) -> &'a i32 { | ++++ ++ ++++ ++ ++ error[E0106]: missing lifetime specifier - --> $DIR/issue-30255.rs:19:44 + --> $DIR/elision-error-omits-lifetimeless-params.rs:19:44 | LL | fn h(a: &bool, b: bool, c: &S, d: &i32) -> &i32 { | ----- -- ---- ^ expected named lifetime parameter diff --git a/tests/ui/issues/issue-30371.rs b/tests/ui/lint/unused/for-loop-no-spurious-unused-variable-lint.rs similarity index 59% rename from tests/ui/issues/issue-30371.rs rename to tests/ui/lint/unused/for-loop-no-spurious-unused-variable-lint.rs index d3ac5fd9587d1..6b266d7cc522c 100644 --- a/tests/ui/issues/issue-30371.rs +++ b/tests/ui/lint/unused/for-loop-no-spurious-unused-variable-lint.rs @@ -1,4 +1,7 @@ +//! Regression test for . +//! This used to emit unused variable warning. //@ run-pass + #![allow(unreachable_code)] #![allow(for_loops_over_fallibles)] #![deny(unused_variables)] diff --git a/tests/ui/issues/issue-31011.rs b/tests/ui/macros/no-field-error-in-macro-expansion-for-generic.rs similarity index 83% rename from tests/ui/issues/issue-31011.rs rename to tests/ui/macros/no-field-error-in-macro-expansion-for-generic.rs index 078d8b2d50fc7..ed4a9a08c222c 100644 --- a/tests/ui/issues/issue-31011.rs +++ b/tests/ui/macros/no-field-error-in-macro-expansion-for-generic.rs @@ -1,3 +1,5 @@ +//! Regression test for . +//! This macro used to ICE with unprintable span. //@ dont-require-annotations: NOTE macro_rules! log { diff --git a/tests/ui/issues/issue-31011.stderr b/tests/ui/macros/no-field-error-in-macro-expansion-for-generic.stderr similarity index 89% rename from tests/ui/issues/issue-31011.stderr rename to tests/ui/macros/no-field-error-in-macro-expansion-for-generic.stderr index 701141ee4406c..600a569a84ce2 100644 --- a/tests/ui/issues/issue-31011.stderr +++ b/tests/ui/macros/no-field-error-in-macro-expansion-for-generic.stderr @@ -1,5 +1,5 @@ error[E0609]: no field `trace` on type `&T` - --> $DIR/issue-31011.rs:5:17 + --> $DIR/no-field-error-in-macro-expansion-for-generic.rs:7:17 | LL | if $ctx.trace { | ^^^^^ unknown field diff --git a/tests/ui/issues/issue-31776.rs b/tests/ui/privacy/required-pub-in-blocks.rs similarity index 86% rename from tests/ui/issues/issue-31776.rs rename to tests/ui/privacy/required-pub-in-blocks.rs index abe6c7ecee58e..aaf273641c917 100644 --- a/tests/ui/issues/issue-31776.rs +++ b/tests/ui/privacy/required-pub-in-blocks.rs @@ -1,8 +1,10 @@ +//! Regression test for . +//! Various scenarios in which `pub` is required in blocks. //@ run-pass + #![allow(dead_code)] #![allow(unused_variables)] #![allow(non_local_definitions)] -// Various scenarios in which `pub` is required in blocks struct S; diff --git a/tests/ui/issues/issue-3149.rs b/tests/ui/resolve/generic-struct-and-fn-share-name.rs similarity index 83% rename from tests/ui/issues/issue-3149.rs rename to tests/ui/resolve/generic-struct-and-fn-share-name.rs index 76744213d51da..7bcb64ffbc80d 100644 --- a/tests/ui/issues/issue-3149.rs +++ b/tests/ui/resolve/generic-struct-and-fn-share-name.rs @@ -1,4 +1,7 @@ +//! Regression test for . +//! This wrongly emitted a duplicate definition of value error. //@ check-pass + #![allow(dead_code)] #![allow(non_snake_case)] diff --git a/tests/ui/issues/issue-30589.rs b/tests/ui/resolve/impl-trait-for-undeclared-type.rs similarity index 62% rename from tests/ui/issues/issue-30589.rs rename to tests/ui/resolve/impl-trait-for-undeclared-type.rs index 94eb5839958af..e023020cd71b6 100644 --- a/tests/ui/issues/issue-30589.rs +++ b/tests/ui/resolve/impl-trait-for-undeclared-type.rs @@ -1,3 +1,6 @@ +//! Regression test for . +//! This used to ICE when coherence encountered an erroneous type. + use std::fmt; impl fmt::Display for DecoderError { //~ ERROR cannot find type `DecoderError` in this scope diff --git a/tests/ui/issues/issue-30589.stderr b/tests/ui/resolve/impl-trait-for-undeclared-type.stderr similarity index 84% rename from tests/ui/issues/issue-30589.stderr rename to tests/ui/resolve/impl-trait-for-undeclared-type.stderr index 43d80896edf8c..72319af983dc6 100644 --- a/tests/ui/issues/issue-30589.stderr +++ b/tests/ui/resolve/impl-trait-for-undeclared-type.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find type `DecoderError` in this scope - --> $DIR/issue-30589.rs:3:23 + --> $DIR/impl-trait-for-undeclared-type.rs:6:23 | LL | impl fmt::Display for DecoderError { | ^^^^^^^^^^^^ not found in this scope diff --git a/tests/ui/issues/issue-3344.rs b/tests/ui/traits/error-reporting/incomplete-partial-ord-impl.rs similarity index 67% rename from tests/ui/issues/issue-3344.rs rename to tests/ui/traits/error-reporting/incomplete-partial-ord-impl.rs index de764b3d075d3..f4e0ced169972 100644 --- a/tests/ui/issues/issue-3344.rs +++ b/tests/ui/traits/error-reporting/incomplete-partial-ord-impl.rs @@ -1,3 +1,6 @@ +//! Regression test for . +//! Unimplemented items in impl caused ICE. + #[derive(PartialEq)] struct Thing(usize); impl PartialOrd for Thing { //~ ERROR not all trait items implemented, missing: `partial_cmp` diff --git a/tests/ui/issues/issue-3344.stderr b/tests/ui/traits/error-reporting/incomplete-partial-ord-impl.stderr similarity index 89% rename from tests/ui/issues/issue-3344.stderr rename to tests/ui/traits/error-reporting/incomplete-partial-ord-impl.stderr index eac8f10fcc164..cae998c653397 100644 --- a/tests/ui/issues/issue-3344.stderr +++ b/tests/ui/traits/error-reporting/incomplete-partial-ord-impl.stderr @@ -1,5 +1,5 @@ error[E0046]: not all trait items implemented, missing: `partial_cmp` - --> $DIR/issue-3344.rs:3:1 + --> $DIR/incomplete-partial-ord-impl.rs:6:1 | LL | impl PartialOrd for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `partial_cmp` in implementation diff --git a/tests/ui/typeck/parenthesized-type-parameters-error-32995.rs b/tests/ui/typeck/parenthesized-type-parameters-error-32995.rs deleted file mode 100644 index e0c2ab5f303a3..0000000000000 --- a/tests/ui/typeck/parenthesized-type-parameters-error-32995.rs +++ /dev/null @@ -1,14 +0,0 @@ -// https://github.com/rust-lang/rust/issues/32995 -fn main() { - { fn f() {} } - //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait - - { fn f() -> impl ::std::marker()::Send { } } - //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait -} - -#[derive(Clone)] -struct X; - -impl ::std::marker()::Copy for X {} -//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait diff --git a/tests/ui/typeck/parenthesized-type-parameters-error-32995.stderr b/tests/ui/typeck/parenthesized-type-parameters-error-32995.stderr deleted file mode 100644 index 590cdcdb43bc3..0000000000000 --- a/tests/ui/typeck/parenthesized-type-parameters-error-32995.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/parenthesized-type-parameters-error-32995.rs:3:22 - | -LL | { fn f() {} } - | ^^^^^^^^ only `Fn` traits may use parentheses - -error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/parenthesized-type-parameters-error-32995.rs:6:29 - | -LL | { fn f() -> impl ::std::marker()::Send { } } - | ^^^^^^^^ only `Fn` traits may use parentheses - -error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/parenthesized-type-parameters-error-32995.rs:13:13 - | -LL | impl ::std::marker()::Copy for X {} - | ^^^^^^^^ only `Fn` traits may use parentheses - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0214`. diff --git a/tests/ui/issues/issue-32995.rs b/tests/ui/typeck/parenthesized-type-params-in-paths.rs similarity index 62% rename from tests/ui/issues/issue-32995.rs rename to tests/ui/typeck/parenthesized-type-params-in-paths.rs index 0d07a76939f2a..85321cc305384 100644 --- a/tests/ui/issues/issue-32995.rs +++ b/tests/ui/typeck/parenthesized-type-params-in-paths.rs @@ -1,3 +1,7 @@ +//! Regression test for . +//! Test parenthesized type params syntax is forbidden for non `Fn` trait, +//! and can't be used in paths. + fn main() { let x: usize() = 1; //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait @@ -16,8 +20,21 @@ fn main() { let o : Box = Box::new(1); //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait + + { fn f() {} } + //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait + + { fn f() -> impl ::std::marker()::Send { } } + //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait + } +#[derive(Clone)] +struct X; + +impl ::std::marker()::Copy for X {} +//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait + fn foo() { let d : X() = Default::default(); //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait diff --git a/tests/ui/issues/issue-32995.stderr b/tests/ui/typeck/parenthesized-type-params-in-paths.stderr similarity index 56% rename from tests/ui/issues/issue-32995.stderr rename to tests/ui/typeck/parenthesized-type-params-in-paths.stderr index b868011b99b24..7a8a4afbfd113 100644 --- a/tests/ui/issues/issue-32995.stderr +++ b/tests/ui/typeck/parenthesized-type-params-in-paths.stderr @@ -1,45 +1,63 @@ error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995.rs:2:12 + --> $DIR/parenthesized-type-params-in-paths.rs:6:12 | LL | let x: usize() = 1; | ^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995.rs:5:19 + --> $DIR/parenthesized-type-params-in-paths.rs:9:19 | LL | let b: ::std::boxed()::Box<_> = Box::new(1); | ^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995.rs:8:20 + --> $DIR/parenthesized-type-params-in-paths.rs:12:20 | LL | let p = ::std::str::()::from_utf8(b"foo").unwrap(); | ^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995.rs:11:25 + --> $DIR/parenthesized-type-params-in-paths.rs:15:25 | LL | let p = ::std::str::from_utf8::()(b"foo").unwrap(); | ^^^^^^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995.rs:14:29 + --> $DIR/parenthesized-type-params-in-paths.rs:18:29 | LL | let o : Box = Box::new(1); | ^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995.rs:17:35 + --> $DIR/parenthesized-type-params-in-paths.rs:21:35 | LL | let o : Box = Box::new(1); | ^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995.rs:22:13 + --> $DIR/parenthesized-type-params-in-paths.rs:24:22 + | +LL | { fn f() {} } + | ^^^^^^^^ only `Fn` traits may use parentheses + +error[E0214]: parenthesized type parameters may only be used with a `Fn` trait + --> $DIR/parenthesized-type-params-in-paths.rs:27:29 + | +LL | { fn f() -> impl ::std::marker()::Send { } } + | ^^^^^^^^ only `Fn` traits may use parentheses + +error[E0214]: parenthesized type parameters may only be used with a `Fn` trait + --> $DIR/parenthesized-type-params-in-paths.rs:35:13 + | +LL | impl ::std::marker()::Copy for X {} + | ^^^^^^^^ only `Fn` traits may use parentheses + +error[E0214]: parenthesized type parameters may only be used with a `Fn` trait + --> $DIR/parenthesized-type-params-in-paths.rs:39:13 | LL | let d : X() = Default::default(); | ^^^ only `Fn` traits may use parentheses -error: aborting due to 7 previous errors +error: aborting due to 10 previous errors For more information about this error, try `rustc --explain E0214`.