]>
Commit | Line | Data |
---|---|---|
e74abb32 | 1 | error[E0038]: the trait `Foo` cannot be made into an object |
60c5eb7d | 2 | --> $DIR/arbitrary-self-types-not-object-safe.rs:33:32 |
e74abb32 | 3 | | |
74b04a01 XL |
4 | LL | trait Foo { |
5 | | --- this trait cannot be made into an object... | |
e74abb32 | 6 | LL | fn foo(self: &Rc<Self>) -> usize; |
74b04a01 XL |
7 | | --------- |
8 | | | | |
9 | | ...because method `foo`'s `self` parameter cannot be dispatched on | |
10 | | help: consider changing method `foo`'s `self` parameter to be `&self`: `&Self` | |
e74abb32 XL |
11 | ... |
12 | LL | let x = Rc::new(5usize) as Rc<dyn Foo>; | |
13 | | ^^^^^^^^^^^ the trait `Foo` cannot be made into an object | |
14 | ||
15 | error[E0038]: the trait `Foo` cannot be made into an object | |
60c5eb7d | 16 | --> $DIR/arbitrary-self-types-not-object-safe.rs:33:13 |
e74abb32 | 17 | | |
74b04a01 XL |
18 | LL | trait Foo { |
19 | | --- this trait cannot be made into an object... | |
e74abb32 | 20 | LL | fn foo(self: &Rc<Self>) -> usize; |
74b04a01 XL |
21 | | --------- |
22 | | | | |
23 | | ...because method `foo`'s `self` parameter cannot be dispatched on | |
24 | | help: consider changing method `foo`'s `self` parameter to be `&self`: `&Self` | |
e74abb32 XL |
25 | ... |
26 | LL | let x = Rc::new(5usize) as Rc<dyn Foo>; | |
27 | | ^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object | |
28 | | | |
1b1a35ee XL |
29 | = note: required because of the requirements on the impl of `CoerceUnsized<Rc<dyn Foo>>` for `Rc<usize>` |
30 | = note: required by cast to type `Rc<dyn Foo>` | |
e74abb32 XL |
31 | |
32 | error: aborting due to 2 previous errors | |
33 | ||
34 | For more information about this error, try `rustc --explain E0038`. |