Skip to content

Commit 95b0165

Browse files
Reorganize UI tests after migration
-Rename tests for clarity. -Add issue links and descriptions. -Clean up formatting and comments.
1 parent 8a1d2f7 commit 95b0165

22 files changed

Lines changed: 49 additions & 28 deletions

tests/ui/borrowck/issue-2590.rs renamed to tests/ui/borrowck/cannot-move-out-of-borrowed-field.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://github.com/rust-lang/rust/issues/2590
2+
13
struct Parser {
24
tokens: Vec<isize> ,
35
}

tests/ui/borrowck/issue-2590.stderr renamed to tests/ui/borrowck/cannot-move-out-of-borrowed-field.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0507]: cannot move out of `self.tokens` which is behind a shared reference
2-
--> $DIR/issue-2590.rs:11:9
2+
--> $DIR/cannot-move-out-of-borrowed-field.rs:13:9
33
|
44
LL | self.tokens
55
| ^^^^^^^^^^^ move occurs because `self.tokens` has type `Vec<isize>`, which does not implement the `Copy` trait

tests/ui/borrowck/issue-4335.rs renamed to tests/ui/borrowck/move-out-of-borrowed-content-in-closure.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://github.com/rust-lang/rust/issues/4335
2+
13
#![feature(fn_traits)]
24

35
fn id<T>(t: T) -> T { t }

tests/ui/borrowck/issue-4335.stderr renamed to tests/ui/borrowck/move-out-of-borrowed-content-in-closure.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0507]: cannot move out of `*v`, as `v` is a captured variable in an `FnMut` closure
2-
--> $DIR/issue-4335.rs:6:20
2+
--> $DIR/move-out-of-borrowed-content-in-closure.rs:8:20
33
|
44
LL | fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> {
55
| - ----- move occurs because `*v` has type `T`, which does not implement the `Copy` trait
@@ -12,7 +12,7 @@ LL | id(Box::new(|| *v))
1212
|
1313
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1414
help: if `T` implemented `Clone`, you could clone the value
15-
--> $DIR/issue-4335.rs:5:10
15+
--> $DIR/move-out-of-borrowed-content-in-closure.rs:7:10
1616
|
1717
LL | fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> {
1818
| ^ consider constraining this type parameter with `Clone`

tests/ui/closures/issue-3021-b.rs renamed to tests/ui/closures/capture-dynamic-environment.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://github.com/rust-lang/rust/issues/3021
2+
13
fn siphash(k0 : u64) {
24

35
struct SipHash {

tests/ui/closures/issue-3021-b.stderr renamed to tests/ui/closures/capture-dynamic-environment.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0434]: can't capture dynamic environment in a fn item
2-
--> $DIR/issue-3021-b.rs:9:22
2+
--> $DIR/capture-dynamic-environment.rs:11:22
33
|
44
LL | self.v0 = k0 ^ 0x736f6d6570736575;
55
| ^^

tests/ui/consts/issue-17252.rs renamed to tests/ui/consts/const-eval-cycle-detection.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://github.com/rust-lang/rust/issues/17252
2+
13
const FOO: usize = FOO; //~ ERROR E0391
24
//@ ignore-parallel-frontend query cycle
35
fn main() {

tests/ui/consts/issue-17252.stderr renamed to tests/ui/consts/const-eval-cycle-detection.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
error[E0391]: cycle detected when checking if `FOO` is a trivial const
2-
--> $DIR/issue-17252.rs:1:1
2+
--> $DIR/const-eval-cycle-detection.rs:3:1
33
|
44
LL | const FOO: usize = FOO;
55
| ^^^^^^^^^^^^^^^^
66
|
77
note: ...which requires building MIR for `FOO`...
8-
--> $DIR/issue-17252.rs:1:1
8+
--> $DIR/const-eval-cycle-detection.rs:3:1
99
|
1010
LL | const FOO: usize = FOO;
1111
| ^^^^^^^^^^^^^^^^
1212
= note: ...which again requires checking if `FOO` is a trivial const, completing the cycle
1313
note: cycle used when simplifying constant for the type system `FOO`
14-
--> $DIR/issue-17252.rs:1:1
14+
--> $DIR/const-eval-cycle-detection.rs:3:1
1515
|
1616
LL | const FOO: usize = FOO;
1717
| ^^^^^^^^^^^^^^^^
1818
= 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
1919

2020
error[E0391]: cycle detected when checking if `main::BAR` is a trivial const
21-
--> $DIR/issue-17252.rs:6:9
21+
--> $DIR/const-eval-cycle-detection.rs:8:9
2222
|
2323
LL | const BAR: usize = BAR;
2424
| ^^^^^^^^^^^^^^^^
2525
|
2626
note: ...which requires building MIR for `main::BAR`...
27-
--> $DIR/issue-17252.rs:6:9
27+
--> $DIR/const-eval-cycle-detection.rs:8:9
2828
|
2929
LL | const BAR: usize = BAR;
3030
| ^^^^^^^^^^^^^^^^
3131
= note: ...which again requires checking if `main::BAR` is a trivial const, completing the cycle
3232
note: cycle used when simplifying constant for the type system `main::BAR`
33-
--> $DIR/issue-17252.rs:6:9
33+
--> $DIR/const-eval-cycle-detection.rs:8:9
3434
|
3535
LL | const BAR: usize = BAR;
3636
| ^^^^^^^^^^^^^^^^
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://github.com/rust-lang/rust/issues/2150
2+
13
#![deny(unreachable_code)]
24
#![allow(unused_variables)]
35
#![allow(dead_code)]

tests/ui/lint/issue-2150.stderr renamed to tests/ui/lint/unreachable-code-in-loop.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: unreachable statement
2-
--> $DIR/issue-2150.rs:8:5
2+
--> $DIR/unreachable-code-in-loop.rs:10:5
33
|
44
LL | panic!();
55
| -------- any code following this expression is unreachable
66
LL | for x in &v { i += 1; }
77
| ^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
88
|
99
note: the lint level is defined here
10-
--> $DIR/issue-2150.rs:1:9
10+
--> $DIR/unreachable-code-in-loop.rs:3:9
1111
|
1212
LL | #![deny(unreachable_code)]
1313
| ^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)