Skip to content

Commit 5a96067

Browse files
Rollup merge of #151287 - m15t, r=Kivooeo
Reorganizing `tests/ui/issues` 15 tests [2/N] part of #133895 r? Kivooeo
2 parents 2b112ef + 2c7969a commit 5a96067

30 files changed

Lines changed: 53 additions & 26 deletions

tests/ui/issues/issue-38919.rs renamed to tests/ui/associated-types/associated-type-as-value.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! regression test for <https://github.com/rust-lang/rust/issues/38919>
2+
13
fn foo<T: Iterator>() {
24
T::Item; //~ ERROR no associated item named `Item` found
35
}

tests/ui/issues/issue-38919.stderr renamed to tests/ui/associated-types/associated-type-as-value.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0599]: no associated item named `Item` found for type parameter `T` in the current scope
2-
--> $DIR/issue-38919.rs:2:8
2+
--> $DIR/associated-type-as-value.rs:4:8
33
|
44
LL | fn foo<T: Iterator>() {
55
| - associated item `Item` not found for this type parameter
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! regression test for <https://github.com/rust-lang/rust/issues/17441>
2+
13
fn main() {
24
let _foo = &[1_usize, 2] as [usize];
35
//~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0620]: cast to unsized type: `&[usize; 2]` as `[usize]`
2-
--> $DIR/issue-17441.rs:2:16
2+
--> $DIR/cast-to-unsized-type.rs:4:16
33
|
44
LL | let _foo = &[1_usize, 2] as [usize];
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | let _foo = &[1_usize, 2] as &[usize];
1010
| +
1111

1212
error[E0620]: cast to unsized type: `Box<usize>` as `dyn Debug`
13-
--> $DIR/issue-17441.rs:5:16
13+
--> $DIR/cast-to-unsized-type.rs:7:16
1414
|
1515
LL | let _bar = Box::new(1_usize) as dyn std::fmt::Debug;
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -21,25 +21,25 @@ LL | let _bar = Box::new(1_usize) as Box<dyn std::fmt::Debug>;
2121
| ++++ +
2222

2323
error[E0620]: cast to unsized type: `usize` as `dyn Debug`
24-
--> $DIR/issue-17441.rs:8:16
24+
--> $DIR/cast-to-unsized-type.rs:10:16
2525
|
2626
LL | let _baz = 1_usize as dyn std::fmt::Debug;
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2828
|
2929
help: consider using a box or reference as appropriate
30-
--> $DIR/issue-17441.rs:8:16
30+
--> $DIR/cast-to-unsized-type.rs:10:16
3131
|
3232
LL | let _baz = 1_usize as dyn std::fmt::Debug;
3333
| ^^^^^^^
3434

3535
error[E0620]: cast to unsized type: `[usize; 2]` as `[usize]`
36-
--> $DIR/issue-17441.rs:11:17
36+
--> $DIR/cast-to-unsized-type.rs:13:17
3737
|
3838
LL | let _quux = [1_usize, 2] as [usize];
3939
| ^^^^^^^^^^^^^^^^^^^^^^^
4040
|
4141
help: consider using a box or reference as appropriate
42-
--> $DIR/issue-17441.rs:11:17
42+
--> $DIR/cast-to-unsized-type.rs:13:17
4343
|
4444
LL | let _quux = [1_usize, 2] as [usize];
4545
| ^^^^^^^^^^^^

tests/ui/issues/issue-2995.rs renamed to tests/ui/cast/non-primitive-isize-ref-cast.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! regression test for <https://github.com/rust-lang/rust/issues/2995>
2+
13
fn bad (p: *const isize) {
24
let _q: &isize = p as &isize; //~ ERROR non-primitive cast
35
}

tests/ui/issues/issue-2995.stderr renamed to tests/ui/cast/non-primitive-isize-ref-cast.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0605]: non-primitive cast: `*const isize` as `&isize`
2-
--> $DIR/issue-2995.rs:2:22
2+
--> $DIR/non-primitive-isize-ref-cast.rs:4:22
33
|
44
LL | let _q: &isize = p as &isize;
55
| ^^^^^^^^^^^ invalid cast
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! regression test for <https://github.com/rust-lang/rust/issues/19922>
2+
13
enum Homura {
24
Akemi { madoka: () }
35
}

tests/ui/issues/issue-19922.stderr renamed to tests/ui/enum/enum-nonexisting-field.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0559]: variant `Homura::Akemi` has no field named `kaname`
2-
--> $DIR/issue-19922.rs:6:34
2+
--> $DIR/enum-nonexisting-field.rs:8:34
33
|
44
LL | let homura = Homura::Akemi { kaname: () };
55
| ^^^^^^ `Homura::Akemi` does not have this field
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! regression test for <https://github.com/rust-lang/rust/issues/17351>
12
//@ run-pass
23

34
trait Str { fn foo(&self) {} } //~ WARN method `foo` is never used

tests/ui/issues/issue-17351.stderr renamed to tests/ui/lint/unused/unused-trait-fn.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: method `foo` is never used
2-
--> $DIR/issue-17351.rs:3:16
2+
--> $DIR/unused-trait-fn.rs:4:16
33
|
44
LL | trait Str { fn foo(&self) {} }
55
| --- ^^^

0 commit comments

Comments
 (0)