]>
Commit | Line | Data |
---|---|---|
e74abb32 XL |
1 | error[E0038]: the trait `Trait` cannot be made into an object |
2 | --> $DIR/wf-convert-unsafe-trait-obj.rs:16:25 | |
3 | | | |
29967ef6 XL |
4 | LL | let t: &dyn Trait = &S; |
5 | | ^^ `Trait` cannot be made into an object | |
6 | | | |
7 | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> | |
8 | --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14 | |
9 | | | |
74b04a01 | 10 | LL | trait Trait: Sized {} |
29967ef6 | 11 | | ----- ^^^^^ ...because it requires `Self: Sized` |
74b04a01 XL |
12 | | | |
13 | | this trait cannot be made into an object... | |
49aad941 | 14 | = note: required for the cast from `&S` to `&dyn Trait` |
e74abb32 XL |
15 | |
16 | error[E0038]: the trait `Trait` cannot be made into an object | |
17 | --> $DIR/wf-convert-unsafe-trait-obj.rs:17:17 | |
18 | | | |
29967ef6 XL |
19 | LL | takes_trait(&S); |
20 | | ^^ `Trait` cannot be made into an object | |
21 | | | |
22 | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> | |
23 | --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14 | |
24 | | | |
74b04a01 | 25 | LL | trait Trait: Sized {} |
29967ef6 | 26 | | ----- ^^^^^ ...because it requires `Self: Sized` |
74b04a01 XL |
27 | | | |
28 | | this trait cannot be made into an object... | |
49aad941 | 29 | = note: required for the cast from `&S` to `&dyn Trait` |
e74abb32 XL |
30 | |
31 | error[E0038]: the trait `Trait` cannot be made into an object | |
32 | --> $DIR/wf-convert-unsafe-trait-obj.rs:15:5 | |
33 | | | |
29967ef6 XL |
34 | LL | &S as &dyn Trait; |
35 | | ^^ `Trait` cannot be made into an object | |
36 | | | |
37 | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> | |
38 | --> $DIR/wf-convert-unsafe-trait-obj.rs:6:14 | |
39 | | | |
74b04a01 | 40 | LL | trait Trait: Sized {} |
29967ef6 | 41 | | ----- ^^^^^ ...because it requires `Self: Sized` |
74b04a01 XL |
42 | | | |
43 | | this trait cannot be made into an object... | |
49aad941 | 44 | = note: required for the cast from `&S` to `&dyn Trait` |
e74abb32 XL |
45 | |
46 | error: aborting due to 3 previous errors | |
47 | ||
48 | For more information about this error, try `rustc --explain E0038`. |