Skip to content

Commit 3f90d08

Browse files
committed
bless some tests
1 parent bda58b0 commit 3f90d08

9 files changed

Lines changed: 42 additions & 30 deletions

tests/ui/impl-trait/unsized_coercion.next.stderr

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

tests/ui/impl-trait/unsized_coercion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//@ revisions: next old
55
//@[next] compile-flags: -Znext-solver
66
//@[old] check-pass
7+
//@[next] check-pass
78

89
trait Trait {}
910

@@ -12,7 +13,6 @@ impl Trait for u32 {}
1213
fn hello() -> Box<impl Trait> {
1314
if true {
1415
let x = hello();
15-
//[next]~^ ERROR: the size for values of type `dyn Trait` cannot be known at compilation time
1616
let y: Box<dyn Trait> = x;
1717
}
1818
Box::new(1u32)
Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `dyn Send: Trait` is not satisfied
2-
--> $DIR/unsized_coercion3.rs:13:17
2+
--> $DIR/unsized_coercion3.rs:14:17
33
|
44
LL | let x = hello();
55
| ^^^^^^^ the trait `Trait` is not implemented for `dyn Send`
@@ -9,7 +9,37 @@ help: the trait `Trait` is implemented for `u32`
99
|
1010
LL | impl Trait for u32 {}
1111
| ^^^^^^^^^^^^^^^^^^
12+
note: required by a bound in `Box`
13+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
1214

13-
error: aborting due to 1 previous error
15+
error[E0308]: mismatched types
16+
--> $DIR/unsized_coercion3.rs:19:5
17+
|
18+
LL | fn hello() -> Box<impl Trait + ?Sized> {
19+
| ------------------------
20+
| | |
21+
| | the expected opaque type
22+
| expected `Box<impl Trait + ?Sized>` because of return type
23+
...
24+
LL | Box::new(1u32)
25+
| ^^^^^^^^^^^^^^ types differ
26+
|
27+
= note: expected struct `Box<impl Trait + ?Sized>`
28+
found struct `Box<u32>`
29+
30+
error[E0277]: the trait bound `dyn Send: Trait` is not satisfied
31+
--> $DIR/unsized_coercion3.rs:11:1
32+
|
33+
LL | fn hello() -> Box<impl Trait + ?Sized> {
34+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `dyn Send`
35+
|
36+
help: the trait `Trait` is implemented for `u32`
37+
--> $DIR/unsized_coercion3.rs:9:1
38+
|
39+
LL | impl Trait for u32 {}
40+
| ^^^^^^^^^^^^^^^^^^
41+
42+
error: aborting due to 3 previous errors
1443

15-
For more information about this error, try `rustc --explain E0277`.
44+
Some errors have detailed explanations: E0277, E0308.
45+
For more information about an error, try `rustc --explain E0277`.

tests/ui/impl-trait/unsized_coercion3.old.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time
2-
--> $DIR/unsized_coercion3.rs:15:32
2+
--> $DIR/unsized_coercion3.rs:16:32
33
|
44
LL | let y: Box<dyn Send> = x;
55
| ^ doesn't have a size known at compile-time

tests/ui/impl-trait/unsized_coercion3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ trait Trait {}
99
impl Trait for u32 {}
1010

1111
fn hello() -> Box<impl Trait + ?Sized> {
12+
//[next]~^ ERROR: the trait bound `dyn Send: Trait` is not satisfied
1213
if true {
1314
let x = hello();
1415
//[next]~^ ERROR: the trait bound `dyn Send: Trait` is not satisfied
1516
let y: Box<dyn Send> = x;
1617
//[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be know
1718
}
1819
Box::new(1u32)
20+
//[next]~^ ERROR: mismatched types
1921
}
2022

2123
fn main() {}

tests/ui/methods/rigid-alias-bound-is-not-inherent.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: candidate #1 is defined in the trait `Trait1`
99
|
1010
LL | fn method(&self) {
1111
| ^^^^^^^^^^^^^^^^
12-
note: candidate #2 is defined in the trait `Trait2`
12+
note: candidate #2 is defined in an impl of the trait `Trait2` for the type `T`
1313
--> $DIR/rigid-alias-bound-is-not-inherent.rs:27:5
1414
|
1515
LL | fn method(&self) {

tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.current.fixed

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ fn main() {
88
//[next]~^^ ERROR expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found
99
let _ = (-10..=10).find(|x: &i32| x.signum() == 0);
1010
//[current]~^ ERROR type mismatch in closure arguments
11-
//[next]~^^ ERROR expected `RangeInclusive<{integer}>` to be an iterator that yields `&&i32`, but it yields `{integer}`
12-
//[next]~| ERROR expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found
11+
//[next]~^^ ERROR expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found
1312
}

tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.next.stderr

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ LL | let _ = (-10..=10).find(|x: i32| x.signum() == 0);
1212
note: required by a bound in `find`
1313
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
1414

15-
error[E0271]: expected `RangeInclusive<{integer}>` to be an iterator that yields `&&i32`, but it yields `{integer}`
16-
--> $DIR/closure-arg-type-mismatch-issue-45727.rs:9:24
17-
|
18-
LL | let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
19-
| ^^^^ expected `&&i32`, found integer
20-
2115
error[E0277]: expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
2216
--> $DIR/closure-arg-type-mismatch-issue-45727.rs:9:29
2317
|
@@ -32,7 +26,6 @@ LL | let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
3226
note: required by a bound in `find`
3327
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
3428

35-
error: aborting due to 3 previous errors
29+
error: aborting due to 2 previous errors
3630

37-
Some errors have detailed explanations: E0271, E0277.
38-
For more information about an error, try `rustc --explain E0271`.
31+
For more information about this error, try `rustc --explain E0277`.

tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ fn main() {
88
//[next]~^^ ERROR expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found
99
let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
1010
//[current]~^ ERROR type mismatch in closure arguments
11-
//[next]~^^ ERROR expected `RangeInclusive<{integer}>` to be an iterator that yields `&&i32`, but it yields `{integer}`
12-
//[next]~| ERROR expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found
11+
//[next]~^^ ERROR expected a `FnMut(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item)` closure, found
1312
}

0 commit comments

Comments
 (0)