1
1
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
3
3
|
4
4
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
5
5
| ----- ^^^^^
@@ -9,27 +9,43 @@ LL | let x: Vec<dyn Trait + Sized> = Vec::new();
9
9
| first non-auto trait
10
10
| trait alias used in trait object type (first use)
11
11
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
14
14
|
15
15
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
16
16
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
17
17
|
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 `
19
19
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
20
20
= note: required by `std::vec::Vec`
21
21
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
24
32
|
25
33
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
26
34
| ^^^^^^^^ doesn't have a size known at compile-time
27
35
|
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 `
29
37
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
30
38
= note: required by `std::vec::Vec::<T>::new`
31
39
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
33
49
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 `.
0 commit comments