Skip to content

Commit 0f84a30

Browse files
authored
Unrolled build for #141833
Rollup merge of #141833 - Kivooeo:test-reform1, r=jieyouxu `tests/ui`: A New Order [2/N] part of #133895 r? `@jieyouxu` let's try this kind of commits, one for each file, commit's name shows what i did, hope this is not harder to review than previous
2 parents aae43c4 + e7e884b commit 0f84a30

9 files changed

+51
-32
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! Tests that a `Vec<isize>` can call a method defined in a trait (`Foo`)
2+
//! implemented for `&[isize]` with a by-value receiver (`self`), relying on auto-dereferencing
3+
//! from `Vec` to `&[isize]` during method resolution.
4+
5+
//@ run-pass
6+
7+
trait Foo {
8+
fn foo(self);
9+
}
10+
11+
impl<'a> Foo for &'a [isize] {
12+
fn foo(self) {}
13+
}
14+
15+
pub fn main() {
16+
let items = vec![ 3, 5, 1, 2, 4 ];
17+
items.foo();
18+
}

tests/ui/bogus-tag.rs

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

tests/ui/borrow-by-val-method-receiver.rs

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

tests/ui/bounds-lifetime.rs renamed to tests/ui/higher-ranked/higher-ranked-invalid-bounds.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Tests invalid lifetime bounds and generic parameters in higher-ranked types.
2+
13
type A = for<'b, 'a: 'b> fn(); //~ ERROR bounds cannot be used in this context
24
type B = for<'b, 'a: 'b,> fn(); //~ ERROR bounds cannot be used in this context
35
type C = for<'b, 'a: 'b +> fn(); //~ ERROR bounds cannot be used in this context

tests/ui/bounds-lifetime.stderr renamed to tests/ui/higher-ranked/higher-ranked-invalid-bounds.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error: bounds cannot be used in this context
2-
--> $DIR/bounds-lifetime.rs:1:22
2+
--> $DIR/higher-ranked-invalid-bounds.rs:3:22
33
|
44
LL | type A = for<'b, 'a: 'b> fn();
55
| ^^
66

77
error: bounds cannot be used in this context
8-
--> $DIR/bounds-lifetime.rs:2:22
8+
--> $DIR/higher-ranked-invalid-bounds.rs:4:22
99
|
1010
LL | type B = for<'b, 'a: 'b,> fn();
1111
| ^^
1212

1313
error: bounds cannot be used in this context
14-
--> $DIR/bounds-lifetime.rs:3:22
14+
--> $DIR/higher-ranked-invalid-bounds.rs:5:22
1515
|
1616
LL | type C = for<'b, 'a: 'b +> fn();
1717
| ^^
1818

1919
error[E0658]: only lifetime parameters can be used in this context
20-
--> $DIR/bounds-lifetime.rs:4:18
20+
--> $DIR/higher-ranked-invalid-bounds.rs:6:18
2121
|
2222
LL | type D = for<'a, T> fn();
2323
| ^
@@ -27,7 +27,7 @@ LL | type D = for<'a, T> fn();
2727
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2828

2929
error[E0658]: only lifetime parameters can be used in this context
30-
--> $DIR/bounds-lifetime.rs:5:18
30+
--> $DIR/higher-ranked-invalid-bounds.rs:7:18
3131
|
3232
LL | type E = dyn for<T, U> Fn();
3333
| ^ ^

tests/ui/bitwise.rs renamed to tests/ui/numbers-arithmetic/bitwise-ops-platform.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Tests bitwise operations with platform-specific and negative number behavior.
2+
13
//@ run-pass
24

35
#[cfg(any(target_pointer_width = "32"))]

tests/ui/bind-by-move.rs renamed to tests/ui/pattern/pattern-match-arc-move.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Tests moving an `Arc` value out of an `Option` in a match expression.
2+
13
//@ run-pass
24

35
use std::sync::Arc;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//! Tests invalid enum variant in a match expression.
2+
3+
enum Color {
4+
Rgb(isize, isize, isize),
5+
Rgba(isize, isize, isize, isize),
6+
}
7+
8+
fn main() {
9+
let red: Color = Color::Rgb(255, 0, 0);
10+
match red {
11+
Color::Rgb(r, g, b) => {
12+
println!("rgb");
13+
}
14+
Color::Hsl(h, s, l) => {
15+
//~^ ERROR no variant
16+
println!("hsl");
17+
}
18+
}
19+
}

tests/ui/bogus-tag.stderr renamed to tests/ui/pattern/pattern-match-invalid-variant.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error[E0599]: no variant or associated item named `Hsl` found for enum `Color` in the current scope
2-
--> $DIR/bogus-tag.rs:7:16
2+
--> $DIR/pattern-match-invalid-variant.rs:14:16
33
|
4-
LL | enum Color { Rgb(isize, isize, isize), Rgba(isize, isize, isize, isize), }
4+
LL | enum Color {
55
| ---------- variant or associated item `Hsl` not found for this enum
66
...
7-
LL | Color::Hsl(h, s, l) => { println!("hsl"); }
7+
LL | Color::Hsl(h, s, l) => {
88
| ^^^ variant or associated item not found in `Color`
99

1010
error: aborting due to 1 previous error

0 commit comments

Comments
 (0)