diff --git a/tests/ui/issues/issue-45731.rs b/tests/ui/backtrace/sigbus-on-apple-missing-dwarf-backtrace.rs similarity index 88% rename from tests/ui/issues/issue-45731.rs rename to tests/ui/backtrace/sigbus-on-apple-missing-dwarf-backtrace.rs index db11d1dbef1c7..8b1ce5711f2af 100644 --- a/tests/ui/issues/issue-45731.rs +++ b/tests/ui/backtrace/sigbus-on-apple-missing-dwarf-backtrace.rs @@ -1,10 +1,13 @@ -//@ run-pass +//! Regression test for . +//! This used to `SIGBUS` on darwin when DWARF binary was corrupted. + #![allow(unused_variables)] //@ compile-flags:--test -g //@ ignore-ios needs the `.dSYM` files to be moved to the device //@ ignore-tvos needs the `.dSYM` files to be moved to the device //@ ignore-watchos needs the `.dSYM` files to be moved to the device //@ ignore-visionos needs the `.dSYM` files to be moved to the device +//@ run-pass #[cfg(target_vendor = "apple")] #[test] diff --git a/tests/ui/expr/if/if-branch-unsized-str-mismatch.rs b/tests/ui/expr/if/if-branch-unsized-str-mismatch.rs new file mode 100644 index 0000000000000..3f0f6aa17537e --- /dev/null +++ b/tests/ui/expr/if/if-branch-unsized-str-mismatch.rs @@ -0,0 +1,12 @@ +//! Regression test for . +//! This used to emit incorrect type mismatch label pointing at return type. + +fn foo() { + let s = "abc"; + let u: &str = if true { s[..2] } else { s }; + //~^ ERROR mismatched types +} + +fn main() { + foo(); +} diff --git a/tests/ui/issues/issue-46302.stderr b/tests/ui/expr/if/if-branch-unsized-str-mismatch.stderr similarity index 88% rename from tests/ui/issues/issue-46302.stderr rename to tests/ui/expr/if/if-branch-unsized-str-mismatch.stderr index e87c17b2ad365..37c8ae00bde0b 100644 --- a/tests/ui/issues/issue-46302.stderr +++ b/tests/ui/expr/if/if-branch-unsized-str-mismatch.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-46302.rs:3:27 + --> $DIR/if-branch-unsized-str-mismatch.rs:6:27 | LL | let u: &str = if true { s[..2] } else { s }; | ^^^^^^ expected `&str`, found `str` diff --git a/tests/ui/issues/issue-46302.rs b/tests/ui/issues/issue-46302.rs deleted file mode 100644 index ba681d84eff84..0000000000000 --- a/tests/ui/issues/issue-46302.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn foo() { - let s = "abc"; - let u: &str = if true { s[..2] } else { s }; - //~^ ERROR mismatched types -} - -fn main() { - foo(); -} diff --git a/tests/ui/issues/issue-4875.rs b/tests/ui/issues/issue-4875.rs deleted file mode 100644 index 5068399ff0db7..0000000000000 --- a/tests/ui/issues/issue-4875.rs +++ /dev/null @@ -1,14 +0,0 @@ -//@ run-pass -#![allow(dead_code)] -// regression test for issue 4875 - - -pub struct Foo { - data: T, -} - -fn foo(Foo{..}: Foo) { -} - -pub fn main() { -} diff --git a/tests/ui/issues/issue-44730.rs b/tests/ui/macros/doc-attr-macro.rs similarity index 58% rename from tests/ui/issues/issue-44730.rs rename to tests/ui/macros/doc-attr-macro.rs index 0c2af7e9f2f6c..625b710926b82 100644 --- a/tests/ui/issues/issue-44730.rs +++ b/tests/ui/macros/doc-attr-macro.rs @@ -1,3 +1,5 @@ +//! Regression test for . +//! Test `#[doc = $expr]` generates docs. //@ check-pass //! dox diff --git a/tests/ui/issues/issue-44851.rs b/tests/ui/macros/doc-attr-nested-macro.rs similarity index 54% rename from tests/ui/issues/issue-44851.rs rename to tests/ui/macros/doc-attr-nested-macro.rs index d5fe4f6746d9a..2e312873a1f84 100644 --- a/tests/ui/issues/issue-44851.rs +++ b/tests/ui/macros/doc-attr-nested-macro.rs @@ -1,4 +1,7 @@ +//! Regression test for . +//! Test doc attr macro doesn't ICE with macro as an argument. //@ check-pass + macro_rules! a { () => { "a" } } diff --git a/tests/ui/issues/issue-4542.rs b/tests/ui/match/match-cloned-string.rs similarity index 53% rename from tests/ui/issues/issue-4542.rs rename to tests/ui/match/match-cloned-string.rs index 15fd31d92d297..69c0f31312c1e 100644 --- a/tests/ui/issues/issue-4542.rs +++ b/tests/ui/match/match-cloned-string.rs @@ -1,3 +1,5 @@ +//! Regression test for . +//! Test matching cloned `String` doesn't segfault. //@ run-pass use std::env; diff --git a/tests/ui/issues/issue-4541.rs b/tests/ui/match/match-string-slice.rs similarity index 75% rename from tests/ui/issues/issue-4541.rs rename to tests/ui/match/match-string-slice.rs index cf6208478c465..ae18bf28921c1 100644 --- a/tests/ui/issues/issue-4541.rs +++ b/tests/ui/match/match-string-slice.rs @@ -1,3 +1,5 @@ +//! Regression test for . +//! This used to segfault caused by double-free. //@ run-pass fn parse_args() -> String { diff --git a/tests/ui/issues/issue-45801.rs b/tests/ui/methods/generic-method-unsatisfied-bound.rs similarity index 81% rename from tests/ui/issues/issue-45801.rs rename to tests/ui/methods/generic-method-unsatisfied-bound.rs index 780baa896676b..6816028276d9a 100644 --- a/tests/ui/issues/issue-45801.rs +++ b/tests/ui/methods/generic-method-unsatisfied-bound.rs @@ -1,3 +1,6 @@ +//! Regression test for . +//! This used to ICE. + struct Params; pub trait Plugin { diff --git a/tests/ui/issues/issue-45801.stderr b/tests/ui/methods/generic-method-unsatisfied-bound.stderr similarity index 83% rename from tests/ui/issues/issue-45801.stderr rename to tests/ui/methods/generic-method-unsatisfied-bound.stderr index 8a4ac85bf8728..48f5565c3e71c 100644 --- a/tests/ui/issues/issue-45801.stderr +++ b/tests/ui/methods/generic-method-unsatisfied-bound.stderr @@ -1,12 +1,12 @@ error[E0277]: the trait bound `Params: Plugin` is not satisfied - --> $DIR/issue-45801.rs:21:9 + --> $DIR/generic-method-unsatisfied-bound.rs:24:9 | LL | req.get_ref::(); | ^^^^^^^ unsatisfied trait bound | help: the trait `Plugin` is not implemented for `Params` but trait `Plugin` is implemented for it - --> $DIR/issue-45801.rs:14:1 + --> $DIR/generic-method-unsatisfied-bound.rs:17:1 | LL | impl Plugin for Params { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-4517.rs b/tests/ui/mismatched_types/array-arg-expected-usize.rs similarity index 62% rename from tests/ui/issues/issue-4517.rs rename to tests/ui/mismatched_types/array-arg-expected-usize.rs index 778f8f97bccb8..a7d86a9d60dbd 100644 --- a/tests/ui/issues/issue-4517.rs +++ b/tests/ui/mismatched_types/array-arg-expected-usize.rs @@ -1,3 +1,5 @@ +//! Regression test for . +//! Test error message use correct array syntax. //@ dont-require-annotations: NOTE fn bar(int_param: usize) {} diff --git a/tests/ui/issues/issue-4517.stderr b/tests/ui/mismatched_types/array-arg-expected-usize.stderr similarity index 81% rename from tests/ui/issues/issue-4517.stderr rename to tests/ui/mismatched_types/array-arg-expected-usize.stderr index d078c7eb95a3d..2a5f289c18152 100644 --- a/tests/ui/issues/issue-4517.stderr +++ b/tests/ui/mismatched_types/array-arg-expected-usize.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-4517.rs:7:9 + --> $DIR/array-arg-expected-usize.rs:9:9 | LL | bar(foo); | --- ^^^ expected `usize`, found `[u8; 4]` @@ -7,7 +7,7 @@ LL | bar(foo); | arguments to this function are incorrect | note: function defined here - --> $DIR/issue-4517.rs:3:4 + --> $DIR/array-arg-expected-usize.rs:5:4 | LL | fn bar(int_param: usize) {} | ^^^ ---------------- diff --git a/tests/ui/pattern/struct-pattern-in-fn-arg.rs b/tests/ui/pattern/struct-pattern-in-fn-arg.rs new file mode 100644 index 0000000000000..62df2538295b4 --- /dev/null +++ b/tests/ui/pattern/struct-pattern-in-fn-arg.rs @@ -0,0 +1,15 @@ +//! Regression test for . +//! Test struct patterns as fn arguments don't ICE. +//@ run-pass +#![allow(dead_code)] + + +pub struct Foo { + data: T, +} + +fn foo(Foo{..}: Foo) { +} + +pub fn main() { +} diff --git a/tests/ui/issues/issue-49298.rs b/tests/ui/uninhabited/uninhabited-tuple-field-layout.rs similarity index 51% rename from tests/ui/issues/issue-49298.rs rename to tests/ui/uninhabited/uninhabited-tuple-field-layout.rs index b10b5b90fd73a..b3be1e2c2c7a8 100644 --- a/tests/ui/issues/issue-49298.rs +++ b/tests/ui/uninhabited/uninhabited-tuple-field-layout.rs @@ -1,23 +1,24 @@ +//! Regression test for . +//! +//! This test is checking that the space allocated for `x.1` does not +//! overlap with `y`. (The reason why such a thing happened at one +//! point was because `x.0: Void` and thus the whole type of `x` was +//! uninhabited, and so the compiler thought it was safe to use the +//! space of `x.1` to hold `y`.) +//! +//! That's a fine thing to test when this code is accepted by the +//! compiler, and this code is being transcribed accordingly into +//! the ui test issue-21232-partial-init-and-use.rs +//! +//! This test is bogus (i.e., should be check-fail) during the period +//! where #54986 is implemented and #54987 is *not* implemented. For +//! now: just ignore it +//! +//@ ignore-test (#54987) //@ run-pass + #![feature(test)] #![allow(unused_mut)] // under NLL we get warning about `x` below: rust-lang/rust#54499 - -// This test is bogus (i.e., should be check-fail) during the period -// where #54986 is implemented and #54987 is *not* implemented. For -// now: just ignore it -// -//@ ignore-test (#54987) - -// This test is checking that the space allocated for `x.1` does not -// overlap with `y`. (The reason why such a thing happened at one -// point was because `x.0: Void` and thus the whole type of `x` was -// uninhabited, and so the compiler thought it was safe to use the -// space of `x.1` to hold `y`.) -// -// That's a fine thing to test when this code is accepted by the -// compiler, and this code is being transcribed accordingly into -// the ui test issue-21232-partial-init-and-use.rs - extern crate test; enum Void {}