Skip to content

Commit cc6f9a4

Browse files
authored
Unrolled build for #143301
Rollup merge of #143301 - Kivooeo:tf26, r=tgross35 `tests/ui`: A New Order [26/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of #133895. r? ````@tgross35````
2 parents 7e310f4 + 9893470 commit cc6f9a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+271
-207
lines changed

tests/ui/auxiliary/svh-a-base.rs

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/ui/auxiliary/svh-b.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/ui/super-let.borrowck.stderr renamed to tests/ui/borrowck/super-let-lifetime-and-drop.borrowck.stderr

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0506]: cannot assign to `x` because it is borrowed
2-
--> $DIR/super-let.rs:30:28
2+
--> $DIR/super-let-lifetime-and-drop.rs:30:28
33
|
44
LL | super let b = DropMe(&mut x);
55
| ------ `x` is borrowed here
@@ -11,7 +11,7 @@ LL | }
1111
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`
1212

1313
error[E0506]: cannot assign to `x` because it is borrowed
14-
--> $DIR/super-let.rs:46:28
14+
--> $DIR/super-let-lifetime-and-drop.rs:46:28
1515
|
1616
LL | super let b = &DropMe(&mut x);
1717
| --------------
@@ -26,7 +26,7 @@ LL | }
2626
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`
2727

2828
error[E0506]: cannot assign to `x` because it is borrowed
29-
--> $DIR/super-let.rs:64:32
29+
--> $DIR/super-let-lifetime-and-drop.rs:64:32
3030
|
3131
LL | super let b = identity(&DropMe(&mut x));
3232
| --------------
@@ -40,7 +40,7 @@ LL | };
4040
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`
4141

4242
error[E0506]: cannot assign to `x` because it is borrowed
43-
--> $DIR/super-let.rs:87:36
43+
--> $DIR/super-let-lifetime-and-drop.rs:87:36
4444
|
4545
LL | super let b = identity(&DropMe(&mut x));
4646
| --------------
@@ -55,7 +55,7 @@ LL | ));
5555
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`
5656

5757
error[E0506]: cannot assign to `x` because it is borrowed
58-
--> $DIR/super-let.rs:107:28
58+
--> $DIR/super-let-lifetime-and-drop.rs:107:28
5959
|
6060
LL | super let b = DropMe(&mut x);
6161
| ------ `x` is borrowed here
@@ -67,7 +67,7 @@ LL | }
6767
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`
6868

6969
error[E0506]: cannot assign to `x` because it is borrowed
70-
--> $DIR/super-let.rs:125:28
70+
--> $DIR/super-let-lifetime-and-drop.rs:125:28
7171
|
7272
LL | super let b = DropMe(&mut x);
7373
| ------ `x` is borrowed here
@@ -79,7 +79,7 @@ LL | }
7979
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`
8080

8181
error[E0506]: cannot assign to `x` because it is borrowed
82-
--> $DIR/super-let.rs:143:28
82+
--> $DIR/super-let-lifetime-and-drop.rs:143:28
8383
|
8484
LL | super let b = DropMe(&mut x);
8585
| ------ `x` is borrowed here
@@ -91,7 +91,7 @@ LL | }
9191
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`
9292

9393
error[E0506]: cannot assign to `x` because it is borrowed
94-
--> $DIR/super-let.rs:159:28
94+
--> $DIR/super-let-lifetime-and-drop.rs:159:28
9595
|
9696
LL | b = DropMe(&mut x);
9797
| ------ `x` is borrowed here
@@ -102,7 +102,7 @@ LL | drop(a);
102102
| - borrow later used here
103103

104104
error[E0716]: temporary value dropped while borrowed
105-
--> $DIR/super-let.rs:172:33
105+
--> $DIR/super-let-lifetime-and-drop.rs:172:33
106106
|
107107
LL | #[cfg(borrowck)] { a = &String::from("asdf"); };
108108
| ^^^^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
@@ -115,7 +115,7 @@ LL | let _ = a;
115115
= note: consider using a `let` binding to create a longer lived value
116116

117117
error[E0506]: cannot assign to `x` because it is borrowed
118-
--> $DIR/super-let.rs:206:28
118+
--> $DIR/super-let-lifetime-and-drop.rs:206:28
119119
|
120120
LL | super let d = &DropMe(&mut x);
121121
| --------------
@@ -130,7 +130,7 @@ LL | }
130130
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`
131131

132132
error[E0506]: cannot assign to `x` because it is borrowed
133-
--> $DIR/super-let.rs:227:32
133+
--> $DIR/super-let-lifetime-and-drop.rs:227:32
134134
|
135135
LL | super let d = identity(&DropMe(&mut x));
136136
| --------------
@@ -145,7 +145,7 @@ LL | };
145145
| - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DropMe`
146146

147147
error[E0506]: cannot assign to `x` because it is borrowed
148-
--> $DIR/super-let.rs:246:28
148+
--> $DIR/super-let-lifetime-and-drop.rs:246:28
149149
|
150150
LL | super let b = DropMe(&mut x);
151151
| ------ `x` is borrowed here
@@ -157,7 +157,7 @@ LL | }
157157
| - borrow might be used here, when `b` is dropped and runs the `Drop` code for type `DropMe`
158158

159159
error[E0506]: cannot assign to `x` because it is borrowed
160-
--> $DIR/super-let.rs:263:28
160+
--> $DIR/super-let-lifetime-and-drop.rs:263:28
161161
|
162162
LL | let dropme = Some(DropMe(&mut x));
163163
| ------ `x` is borrowed here

tests/ui/tag-variant-cast-non-nullary.fixed renamed to tests/ui/cast/cast-enum-to-primitive-error.fixed

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
//! This test verifies that a direct non-primitive cast from an enum to an integer type
2+
//! is correctly disallowed, even when a `From` implementation exists for that enum.
3+
14
//@ run-rustfix
5+
26
#![allow(dead_code, unused_variables)]
7+
38
enum NonNullary {
49
Nullary,
510
Other(isize),
@@ -16,5 +21,7 @@ impl From<NonNullary> for isize {
1621

1722
fn main() {
1823
let v = NonNullary::Nullary;
19-
let val = isize::from(v); //~ ERROR non-primitive cast: `NonNullary` as `isize` [E0605]
24+
let val = isize::from(v);
25+
//~^ ERROR non-primitive cast: `NonNullary` as `isize` [E0605]
26+
//~| HELP consider using the `From` trait instead
2027
}

tests/ui/tag-variant-cast-non-nullary.rs renamed to tests/ui/cast/cast-enum-to-primitive-error.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
//! This test verifies that a direct non-primitive cast from an enum to an integer type
2+
//! is correctly disallowed, even when a `From` implementation exists for that enum.
3+
14
//@ run-rustfix
5+
26
#![allow(dead_code, unused_variables)]
7+
38
enum NonNullary {
49
Nullary,
510
Other(isize),
@@ -16,5 +21,7 @@ impl From<NonNullary> for isize {
1621

1722
fn main() {
1823
let v = NonNullary::Nullary;
19-
let val = v as isize; //~ ERROR non-primitive cast: `NonNullary` as `isize` [E0605]
24+
let val = v as isize;
25+
//~^ ERROR non-primitive cast: `NonNullary` as `isize` [E0605]
26+
//~| HELP consider using the `From` trait instead
2027
}

tests/ui/tag-variant-cast-non-nullary.stderr renamed to tests/ui/cast/cast-enum-to-primitive-error.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: `NonNullary` as `isize`
2-
--> $DIR/tag-variant-cast-non-nullary.rs:19:15
2+
--> $DIR/cast-enum-to-primitive-error.rs:24:15
33
|
44
LL | let val = v as isize;
55
| ^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less

tests/ui/trivial_casts-rpass.rs renamed to tests/ui/cast/coercion-as-explicit-cast.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
//! This test checks that various forms of "trivial" casts and coercions
2+
//! can be explicitly performed using the `as` keyword without compilation errors.
3+
14
//@ run-pass
2-
// Test that all coercions can actually be done using casts (modulo the lints).
35

46
#![allow(trivial_casts, trivial_numeric_casts)]
57

tests/ui/trivial_casts-rpass.stderr renamed to tests/ui/cast/coercion-as-explicit-cast.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/trivial_casts-rpass.rs:7:8
2+
--> $DIR/coercion-as-explicit-cast.rs:9:8
33
|
44
LL | trait Foo {
55
| --- method in this trait
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! This test checks that unused generics are rejected by compiler
2+
3+
enum Quux<T> {
4+
//~^ ERROR: parameter `T` is never used
5+
Bar,
6+
}
7+
8+
fn foo(c: Quux) {
9+
//~^ ERROR missing generics for enum `Quux`
10+
assert!((false));
11+
}
12+
13+
fn main() {
14+
panic!();
15+
}

0 commit comments

Comments
 (0)