]> git.proxmox.com Git - rustc.git/blame - src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / self / arbitrary-self-types-not-object-safe.curr.stderr
CommitLineData
e74abb32 1error[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
4LL | trait Foo {
5 | --- this trait cannot be made into an object...
e74abb32 6LL | 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...
12LL | let x = Rc::new(5usize) as Rc<dyn Foo>;
13 | ^^^^^^^^^^^ the trait `Foo` cannot be made into an object
14
15error[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
18LL | trait Foo {
19 | --- this trait cannot be made into an object...
e74abb32 20LL | 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...
26LL | 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
32error: aborting due to 2 previous errors
33
34For more information about this error, try `rustc --explain E0038`.