diff --git a/tests/ui/issues/issue-2590.rs b/tests/ui/borrowck/cannot-move-out-of-borrowed-field.rs similarity index 81% rename from tests/ui/issues/issue-2590.rs rename to tests/ui/borrowck/cannot-move-out-of-borrowed-field.rs index a9a0e5ca4ec16..e21438f031871 100644 --- a/tests/ui/issues/issue-2590.rs +++ b/tests/ui/borrowck/cannot-move-out-of-borrowed-field.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/2590 + struct Parser { tokens: Vec , } diff --git a/tests/ui/issues/issue-2590.stderr b/tests/ui/borrowck/cannot-move-out-of-borrowed-field.stderr similarity index 90% rename from tests/ui/issues/issue-2590.stderr rename to tests/ui/borrowck/cannot-move-out-of-borrowed-field.stderr index 822856652e9df..79cb64919d5e9 100644 --- a/tests/ui/issues/issue-2590.stderr +++ b/tests/ui/borrowck/cannot-move-out-of-borrowed-field.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of `self.tokens` which is behind a shared reference - --> $DIR/issue-2590.rs:11:9 + --> $DIR/cannot-move-out-of-borrowed-field.rs:13:9 | LL | self.tokens | ^^^^^^^^^^^ move occurs because `self.tokens` has type `Vec`, which does not implement the `Copy` trait diff --git a/tests/ui/issues/issue-4335.rs b/tests/ui/borrowck/move-out-of-borrowed-content-in-closure.rs similarity index 81% rename from tests/ui/issues/issue-4335.rs rename to tests/ui/borrowck/move-out-of-borrowed-content-in-closure.rs index c5914a17cf924..c1d649f74f507 100644 --- a/tests/ui/issues/issue-4335.rs +++ b/tests/ui/borrowck/move-out-of-borrowed-content-in-closure.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/4335 + #![feature(fn_traits)] fn id(t: T) -> T { t } diff --git a/tests/ui/issues/issue-4335.stderr b/tests/ui/borrowck/move-out-of-borrowed-content-in-closure.stderr similarity index 89% rename from tests/ui/issues/issue-4335.stderr rename to tests/ui/borrowck/move-out-of-borrowed-content-in-closure.stderr index d1a64e3dd4620..abf9d65ef4b08 100644 --- a/tests/ui/issues/issue-4335.stderr +++ b/tests/ui/borrowck/move-out-of-borrowed-content-in-closure.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of `*v`, as `v` is a captured variable in an `FnMut` closure - --> $DIR/issue-4335.rs:6:20 + --> $DIR/move-out-of-borrowed-content-in-closure.rs:8:20 | LL | fn f<'r, T>(v: &'r T) -> Box T + 'r> { | - ----- move occurs because `*v` has type `T`, which does not implement the `Copy` trait @@ -12,7 +12,7 @@ LL | id(Box::new(|| *v)) | = help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once help: if `T` implemented `Clone`, you could clone the value - --> $DIR/issue-4335.rs:5:10 + --> $DIR/move-out-of-borrowed-content-in-closure.rs:7:10 | LL | fn f<'r, T>(v: &'r T) -> Box T + 'r> { | ^ consider constraining this type parameter with `Clone` diff --git a/tests/ui/issues/issue-3021-b.rs b/tests/ui/closures/capture-dynamic-environment.rs similarity index 82% rename from tests/ui/issues/issue-3021-b.rs rename to tests/ui/closures/capture-dynamic-environment.rs index f1630afe1730e..2b6c74aa3972e 100644 --- a/tests/ui/issues/issue-3021-b.rs +++ b/tests/ui/closures/capture-dynamic-environment.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/3021 + fn siphash(k0 : u64) { struct SipHash { diff --git a/tests/ui/issues/issue-3021-b.stderr b/tests/ui/closures/capture-dynamic-environment.stderr similarity index 86% rename from tests/ui/issues/issue-3021-b.stderr rename to tests/ui/closures/capture-dynamic-environment.stderr index 48777fec0a3ff..5e31a0b40ba90 100644 --- a/tests/ui/issues/issue-3021-b.stderr +++ b/tests/ui/closures/capture-dynamic-environment.stderr @@ -1,5 +1,5 @@ error[E0434]: can't capture dynamic environment in a fn item - --> $DIR/issue-3021-b.rs:9:22 + --> $DIR/capture-dynamic-environment.rs:11:22 | LL | self.v0 = k0 ^ 0x736f6d6570736575; | ^^ diff --git a/tests/ui/issues/issue-17252.rs b/tests/ui/consts/const-eval-cycle-detection.rs similarity index 86% rename from tests/ui/issues/issue-17252.rs rename to tests/ui/consts/const-eval-cycle-detection.rs index dd002bfd187a0..ba99a6c5147c7 100644 --- a/tests/ui/issues/issue-17252.rs +++ b/tests/ui/consts/const-eval-cycle-detection.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/17252 + const FOO: usize = FOO; //~ ERROR E0391 //@ ignore-parallel-frontend query cycle fn main() { diff --git a/tests/ui/issues/issue-17252.stderr b/tests/ui/consts/const-eval-cycle-detection.stderr similarity index 83% rename from tests/ui/issues/issue-17252.stderr rename to tests/ui/consts/const-eval-cycle-detection.stderr index b0d9d94e07ddf..20737a203b4b1 100644 --- a/tests/ui/issues/issue-17252.stderr +++ b/tests/ui/consts/const-eval-cycle-detection.stderr @@ -1,36 +1,36 @@ error[E0391]: cycle detected when checking if `FOO` is a trivial const - --> $DIR/issue-17252.rs:1:1 + --> $DIR/const-eval-cycle-detection.rs:3:1 | LL | const FOO: usize = FOO; | ^^^^^^^^^^^^^^^^ | note: ...which requires building MIR for `FOO`... - --> $DIR/issue-17252.rs:1:1 + --> $DIR/const-eval-cycle-detection.rs:3:1 | LL | const FOO: usize = FOO; | ^^^^^^^^^^^^^^^^ = note: ...which again requires checking if `FOO` is a trivial const, completing the cycle note: cycle used when simplifying constant for the type system `FOO` - --> $DIR/issue-17252.rs:1:1 + --> $DIR/const-eval-cycle-detection.rs:3:1 | LL | const FOO: usize = FOO; | ^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error[E0391]: cycle detected when checking if `main::BAR` is a trivial const - --> $DIR/issue-17252.rs:6:9 + --> $DIR/const-eval-cycle-detection.rs:8:9 | LL | const BAR: usize = BAR; | ^^^^^^^^^^^^^^^^ | note: ...which requires building MIR for `main::BAR`... - --> $DIR/issue-17252.rs:6:9 + --> $DIR/const-eval-cycle-detection.rs:8:9 | LL | const BAR: usize = BAR; | ^^^^^^^^^^^^^^^^ = note: ...which again requires checking if `main::BAR` is a trivial const, completing the cycle note: cycle used when simplifying constant for the type system `main::BAR` - --> $DIR/issue-17252.rs:6:9 + --> $DIR/const-eval-cycle-detection.rs:8:9 | LL | const BAR: usize = BAR; | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-2150.rs b/tests/ui/lint/unreachable-code-in-loop.rs similarity index 82% rename from tests/ui/issues/issue-2150.rs rename to tests/ui/lint/unreachable-code-in-loop.rs index baa1dde0fc2e8..151d3f5a6f8da 100644 --- a/tests/ui/issues/issue-2150.rs +++ b/tests/ui/lint/unreachable-code-in-loop.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/2150 + #![deny(unreachable_code)] #![allow(unused_variables)] #![allow(dead_code)] diff --git a/tests/ui/issues/issue-2150.stderr b/tests/ui/lint/unreachable-code-in-loop.stderr similarity index 80% rename from tests/ui/issues/issue-2150.stderr rename to tests/ui/lint/unreachable-code-in-loop.stderr index a9268646edfcb..2ed156436cea6 100644 --- a/tests/ui/issues/issue-2150.stderr +++ b/tests/ui/lint/unreachable-code-in-loop.stderr @@ -1,5 +1,5 @@ error: unreachable statement - --> $DIR/issue-2150.rs:8:5 + --> $DIR/unreachable-code-in-loop.rs:10:5 | LL | panic!(); | -------- any code following this expression is unreachable @@ -7,7 +7,7 @@ LL | for x in &v { i += 1; } | ^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | note: the lint level is defined here - --> $DIR/issue-2150.rs:1:9 + --> $DIR/unreachable-code-in-loop.rs:3:9 | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-4972.rs b/tests/ui/pattern/box-pattern-trait-object-deref-error.rs similarity index 85% rename from tests/ui/issues/issue-4972.rs rename to tests/ui/pattern/box-pattern-trait-object-deref-error.rs index 3f1c6f855007c..59ab4aaf61a80 100644 --- a/tests/ui/issues/issue-4972.rs +++ b/tests/ui/pattern/box-pattern-trait-object-deref-error.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/4972 + #![feature(box_patterns)] trait MyTrait { diff --git a/tests/ui/issues/issue-4972.stderr b/tests/ui/pattern/box-pattern-trait-object-deref-error.stderr similarity index 85% rename from tests/ui/issues/issue-4972.stderr rename to tests/ui/pattern/box-pattern-trait-object-deref-error.stderr index 8de3909ca305e..ba49671b373f8 100644 --- a/tests/ui/issues/issue-4972.stderr +++ b/tests/ui/pattern/box-pattern-trait-object-deref-error.stderr @@ -1,5 +1,5 @@ error[E0033]: type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced - --> $DIR/issue-4972.rs:13:25 + --> $DIR/box-pattern-trait-object-deref-error.rs:15:25 | LL | TraitWrapper::A(box ref map) => map, | ^^^^^^^^^^^ type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced diff --git a/tests/ui/issues/issue-5100.rs b/tests/ui/pattern/pattern-mismatched-types-diagnostics.rs similarity index 96% rename from tests/ui/issues/issue-5100.rs rename to tests/ui/pattern/pattern-mismatched-types-diagnostics.rs index e9ae551bb77f4..3b4e57f56557b 100644 --- a/tests/ui/issues/issue-5100.rs +++ b/tests/ui/pattern/pattern-mismatched-types-diagnostics.rs @@ -1,4 +1,5 @@ //@ dont-require-annotations: NOTE +// https://github.com/rust-lang/rust/issues/5100 #![feature(box_patterns)] diff --git a/tests/ui/issues/issue-5100.stderr b/tests/ui/pattern/pattern-mismatched-types-diagnostics.stderr similarity index 84% rename from tests/ui/issues/issue-5100.stderr rename to tests/ui/pattern/pattern-mismatched-types-diagnostics.stderr index c545f70415c13..88c4cac3578ef 100644 --- a/tests/ui/issues/issue-5100.stderr +++ b/tests/ui/pattern/pattern-mismatched-types-diagnostics.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-5100.rs:9:9 + --> $DIR/pattern-mismatched-types-diagnostics.rs:10:9 | LL | match (true, false) { | ------------- this expression has type `(bool, bool)` @@ -10,7 +10,7 @@ LL | A::B => (), found enum `A` error[E0308]: mismatched types - --> $DIR/issue-5100.rs:18:9 + --> $DIR/pattern-mismatched-types-diagnostics.rs:19:9 | LL | match (true, false) { | ------------- this expression has type `(bool, bool)` @@ -21,7 +21,7 @@ LL | (true, false, false) => () found tuple `(_, _, _)` error[E0308]: mismatched types - --> $DIR/issue-5100.rs:26:9 + --> $DIR/pattern-mismatched-types-diagnostics.rs:27:9 | LL | match (true, false) { | ------------- this expression has type `(bool, bool)` @@ -32,7 +32,7 @@ LL | (true, false, false) => () found tuple `(_, _, _)` error[E0308]: mismatched types - --> $DIR/issue-5100.rs:34:9 + --> $DIR/pattern-mismatched-types-diagnostics.rs:35:9 | LL | match (true, false) { | ------------- this expression has type `(bool, bool)` @@ -43,7 +43,7 @@ LL | box (true, false) => () found struct `Box<_>` error[E0308]: mismatched types - --> $DIR/issue-5100.rs:41:9 + --> $DIR/pattern-mismatched-types-diagnostics.rs:42:9 | LL | match (true, false) { | ------------- this expression has type `(bool, bool)` @@ -54,13 +54,13 @@ LL | &(true, false) => () found reference `&_` error[E0618]: expected function, found `(char, char)` - --> $DIR/issue-5100.rs:49:14 + --> $DIR/pattern-mismatched-types-diagnostics.rs:50:14 | LL | let v = [('a', 'b') | ^^^^^^^^^^- help: consider separating array elements with a comma: `,` error[E0308]: mismatched types - --> $DIR/issue-5100.rs:56:19 + --> $DIR/pattern-mismatched-types-diagnostics.rs:57:19 | LL | let x: char = true; | ---- ^^^^ expected `char`, found `bool` diff --git a/tests/ui/issues/issue-17800.rs b/tests/ui/pattern/tuple-variant-written-as-struct-pattern.rs similarity index 82% rename from tests/ui/issues/issue-17800.rs rename to tests/ui/pattern/tuple-variant-written-as-struct-pattern.rs index 5254f45d7c2de..95f69d53c09d9 100644 --- a/tests/ui/issues/issue-17800.rs +++ b/tests/ui/pattern/tuple-variant-written-as-struct-pattern.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/17800 + enum MyOption { MySome(T), MyNone, diff --git a/tests/ui/issues/issue-17800.stderr b/tests/ui/pattern/tuple-variant-written-as-struct-pattern.stderr similarity index 87% rename from tests/ui/issues/issue-17800.stderr rename to tests/ui/pattern/tuple-variant-written-as-struct-pattern.stderr index 322c77eaa1dc5..39f3461b8b18a 100644 --- a/tests/ui/issues/issue-17800.stderr +++ b/tests/ui/pattern/tuple-variant-written-as-struct-pattern.stderr @@ -1,5 +1,5 @@ error[E0769]: tuple variant `MyOption::MySome` written as struct variant - --> $DIR/issue-17800.rs:8:9 + --> $DIR/tuple-variant-written-as-struct-pattern.rs:10:9 | LL | MyOption::MySome { x: 42 } => (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-3702-2.rs b/tests/ui/traits/method-resolution-multiple-traits.rs similarity index 89% rename from tests/ui/issues/issue-3702-2.rs rename to tests/ui/traits/method-resolution-multiple-traits.rs index d47f6d248f708..4393e18068e18 100644 --- a/tests/ui/issues/issue-3702-2.rs +++ b/tests/ui/traits/method-resolution-multiple-traits.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/3702 + pub trait ToPrimitive { fn to_int(&self) -> isize { 0 } } diff --git a/tests/ui/issues/issue-3702-2.stderr b/tests/ui/traits/method-resolution-multiple-traits.stderr similarity index 85% rename from tests/ui/issues/issue-3702-2.stderr rename to tests/ui/traits/method-resolution-multiple-traits.stderr index 448263aafd44e..78a793a8de634 100644 --- a/tests/ui/issues/issue-3702-2.stderr +++ b/tests/ui/traits/method-resolution-multiple-traits.stderr @@ -1,16 +1,16 @@ error[E0034]: multiple applicable items in scope - --> $DIR/issue-3702-2.rs:16:14 + --> $DIR/method-resolution-multiple-traits.rs:18:14 | LL | self.to_int() + other.to_int() | ^^^^^^ multiple `to_int` found | note: candidate #1 is defined in an impl of the trait `Add` for the type `isize` - --> $DIR/issue-3702-2.rs:14:5 + --> $DIR/method-resolution-multiple-traits.rs:16:5 | LL | fn to_int(&self) -> isize { *self } | ^^^^^^^^^^^^^^^^^^^^^^^^^ note: candidate #2 is defined in an impl of the trait `ToPrimitive` for the type `isize` - --> $DIR/issue-3702-2.rs:2:5 + --> $DIR/method-resolution-multiple-traits.rs:4:5 | LL | fn to_int(&self) -> isize { 0 } | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-4265.rs b/tests/ui/typeck/duplicate-method-definitions-in-impl.rs similarity index 80% rename from tests/ui/issues/issue-4265.rs rename to tests/ui/typeck/duplicate-method-definitions-in-impl.rs index 99b13283bc972..bee01e60c159b 100644 --- a/tests/ui/issues/issue-4265.rs +++ b/tests/ui/typeck/duplicate-method-definitions-in-impl.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/4265 + struct Foo { baz: usize } diff --git a/tests/ui/issues/issue-4265.stderr b/tests/ui/typeck/duplicate-method-definitions-in-impl.stderr similarity index 85% rename from tests/ui/issues/issue-4265.stderr rename to tests/ui/typeck/duplicate-method-definitions-in-impl.stderr index d4a44c129a89e..adfa3fb837f79 100644 --- a/tests/ui/issues/issue-4265.stderr +++ b/tests/ui/typeck/duplicate-method-definitions-in-impl.stderr @@ -1,5 +1,5 @@ error[E0592]: duplicate definitions with name `bar` - --> $DIR/issue-4265.rs:11:5 + --> $DIR/duplicate-method-definitions-in-impl.rs:13:5 | LL | fn bar() { | -------- other definition for `bar` @@ -8,7 +8,7 @@ LL | fn bar() { | ^^^^^^^^ duplicate definitions for `bar` error[E0599]: no method named `bar` found for struct `Foo` in the current scope - --> $DIR/issue-4265.rs:7:24 + --> $DIR/duplicate-method-definitions-in-impl.rs:9:24 | LL | struct Foo { | ---------- method `bar` not found for this struct @@ -18,7 +18,7 @@ LL | Foo { baz: 0 }.bar(); | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `Foo` - --> $DIR/issue-4265.rs:6:5 + --> $DIR/duplicate-method-definitions-in-impl.rs:8:5 | LL | fn bar() { | ^^^^^^^^ diff --git a/tests/ui/issues/issue-4736.rs b/tests/ui/typeck/tuple-struct-field-constructor-error.rs similarity index 71% rename from tests/ui/issues/issue-4736.rs rename to tests/ui/typeck/tuple-struct-field-constructor-error.rs index 799d2d4809860..979fd030b3394 100644 --- a/tests/ui/issues/issue-4736.rs +++ b/tests/ui/typeck/tuple-struct-field-constructor-error.rs @@ -1,3 +1,5 @@ +// https://github.com/rust-lang/rust/issues/4736 + struct NonCopyable(()); fn main() { diff --git a/tests/ui/issues/issue-4736.stderr b/tests/ui/typeck/tuple-struct-field-constructor-error.stderr similarity index 90% rename from tests/ui/issues/issue-4736.stderr rename to tests/ui/typeck/tuple-struct-field-constructor-error.stderr index b099e528ca8a8..2a14e8593480b 100644 --- a/tests/ui/issues/issue-4736.stderr +++ b/tests/ui/typeck/tuple-struct-field-constructor-error.stderr @@ -1,5 +1,5 @@ error[E0560]: struct `NonCopyable` has no field named `p` - --> $DIR/issue-4736.rs:4:26 + --> $DIR/tuple-struct-field-constructor-error.rs:6:26 | LL | struct NonCopyable(()); | ----------- `NonCopyable` defined here