Skip to content

Commit 34080fb

Browse files
author
Alexander Regueiro
committed
Reblessed some tests.
1 parent 0f84812 commit 34080fb

File tree

5 files changed

+52
-23
lines changed

5 files changed

+52
-23
lines changed

src/test/ui/associated-types/associated-types-overridden-binding-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as std::iter::It
44
LL | let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
55
| ^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
66
|
7-
= note: required for the cast to the object type `dyn std::iter::Iterator<Item = u32, Item = i32>`
7+
= note: required for the cast to the object type `dyn I32Iterator<Item = u32, Item = i32>`
88

99
error: aborting due to previous error
1010

src/test/ui/bad/bad-sized.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
// ignore-tidy-linelength
2+
13
trait Trait {}
24

35
pub fn main() {
46
let x: Vec<dyn Trait + Sized> = Vec::new();
5-
//~^ ERROR only auto traits can be used as additional traits in a trait object
6-
//~| ERROR the size for values of type
7-
//~| ERROR the size for values of type
7+
//~^ ERROR only auto traits can be used as additional traits in a trait object [E0225]
8+
//~| ERROR the size for values of type `dyn std::marker::Sized` cannot be known at compilation time [E0277]
9+
//~| the trait `std::marker::Sized` cannot be made into an object [E0038]
10+
//~| ERROR the size for values of type `dyn std::marker::Sized` cannot be known at compilation time [E0277]
11+
//~| the trait `std::marker::Sized` cannot be made into an object [E0038]
812
}

src/test/ui/bad/bad-sized.stderr

+26-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0225]: only auto traits can be used as additional traits in a trait object
2-
--> $DIR/bad-sized.rs:4:28
2+
--> $DIR/bad-sized.rs:6:28
33
|
44
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
55
| ----- ^^^^^
@@ -9,27 +9,43 @@ LL | let x: Vec<dyn Trait + Sized> = Vec::new();
99
| first non-auto trait
1010
| trait alias used in trait object type (first use)
1111

12-
error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
13-
--> $DIR/bad-sized.rs:4:12
12+
error[E0277]: the size for values of type `dyn std::marker::Sized` cannot be known at compilation time
13+
--> $DIR/bad-sized.rs:6:12
1414
|
1515
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
1616
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
1717
|
18-
= help: the trait `std::marker::Sized` is not implemented for `dyn Trait`
18+
= help: the trait `std::marker::Sized` is not implemented for `dyn std::marker::Sized`
1919
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
2020
= note: required by `std::vec::Vec`
2121

22-
error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
23-
--> $DIR/bad-sized.rs:4:37
22+
error[E0038]: the trait `std::marker::Sized` cannot be made into an object
23+
--> $DIR/bad-sized.rs:6:12
24+
|
25+
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
26+
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Sized` cannot be made into an object
27+
|
28+
= note: the trait cannot require that `Self : Sized`
29+
30+
error[E0277]: the size for values of type `dyn std::marker::Sized` cannot be known at compilation time
31+
--> $DIR/bad-sized.rs:6:37
2432
|
2533
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
2634
| ^^^^^^^^ doesn't have a size known at compile-time
2735
|
28-
= help: the trait `std::marker::Sized` is not implemented for `dyn Trait`
36+
= help: the trait `std::marker::Sized` is not implemented for `dyn std::marker::Sized`
2937
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
3038
= note: required by `std::vec::Vec::<T>::new`
3139

32-
error: aborting due to 3 previous errors
40+
error[E0038]: the trait `std::marker::Sized` cannot be made into an object
41+
--> $DIR/bad-sized.rs:6:37
42+
|
43+
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
44+
| ^^^^^^^^ the trait `std::marker::Sized` cannot be made into an object
45+
|
46+
= note: the trait cannot require that `Self : Sized`
47+
48+
error: aborting due to 5 previous errors
3349

34-
Some errors have detailed explanations: E0225, E0277.
35-
For more information about an error, try `rustc --explain E0225`.
50+
Some errors have detailed explanations: E0038, E0225, E0277.
51+
For more information about an error, try `rustc --explain E0038`.

src/test/ui/issues/issue-32963.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ use std::mem;
22

33
trait Misc {}
44

5-
fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
5+
fn size_of_copy<T: Copy + ?Sized>() -> usize { mem::size_of::<T>() }
66

77
fn main() {
88
size_of_copy::<dyn Misc + Copy>();
9-
//~^ ERROR only auto traits can be used as additional traits in a trait object
10-
//~| ERROR the trait bound `dyn Misc: std::marker::Copy` is not satisfied
9+
//~^ ERROR only auto traits can be used as additional traits in a trait object [E0225]
10+
//~| ERROR the trait bound `dyn std::marker::Copy: std::marker::Copy` is not satisfied [E0277]
11+
//~| ERROR the trait `std::marker::Copy` cannot be made into an object [E0038]
1112
}

src/test/ui/issues/issue-32963.stderr

+14-6
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,24 @@ LL | size_of_copy::<dyn Misc + Copy>();
99
| first non-auto trait
1010
| trait alias used in trait object type (first use)
1111

12-
error[E0277]: the trait bound `dyn Misc: std::marker::Copy` is not satisfied
12+
error[E0277]: the trait bound `dyn std::marker::Copy: std::marker::Copy` is not satisfied
1313
--> $DIR/issue-32963.rs:8:5
1414
|
15-
LL | fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
15+
LL | fn size_of_copy<T: Copy + ?Sized>() -> usize { mem::size_of::<T>() }
1616
| ------------ ---- required by this bound in `size_of_copy`
1717
...
1818
LL | size_of_copy::<dyn Misc + Copy>();
19-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `dyn Misc`
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `dyn std::marker::Copy`
2020

21-
error: aborting due to 2 previous errors
21+
error[E0038]: the trait `std::marker::Copy` cannot be made into an object
22+
--> $DIR/issue-32963.rs:8:20
23+
|
24+
LL | size_of_copy::<dyn Misc + Copy>();
25+
| ^^^^^^^^^^^^^^^ the trait `std::marker::Copy` cannot be made into an object
26+
|
27+
= note: the trait cannot require that `Self : Sized`
28+
29+
error: aborting due to 3 previous errors
2230

23-
Some errors have detailed explanations: E0225, E0277.
24-
For more information about an error, try `rustc --explain E0225`.
31+
Some errors have detailed explanations: E0038, E0225, E0277.
32+
For more information about an error, try `rustc --explain E0038`.

0 commit comments

Comments
 (0)