25 lines
768 B
Plaintext
25 lines
768 B
Plaintext
|
error: the `function` method cannot be invoked on a trait object
|
||
|
--> $DIR/mutability-mismatch.rs:28:33
|
||
|
|
|
||
|
LL | Self: Sized;
|
||
|
| ----- this has a `Sized` requirement
|
||
|
...
|
||
|
LL | (&MutType as &dyn MutTrait).function();
|
||
|
| ^^^^^^^^
|
||
|
|
|
||
|
= note: you need `&mut dyn MutTrait` instead of `&dyn MutTrait`
|
||
|
|
||
|
error: the `function` method cannot be invoked on a trait object
|
||
|
--> $DIR/mutability-mismatch.rs:31:35
|
||
|
|
|
||
|
LL | Self: Sized;
|
||
|
| ----- this has a `Sized` requirement
|
||
|
...
|
||
|
LL | (&mut Type as &mut dyn Trait).function();
|
||
|
| ^^^^^^^^
|
||
|
|
|
||
|
= note: you need `&dyn Trait` instead of `&mut dyn Trait`
|
||
|
|
||
|
error: aborting due to 2 previous errors
|
||
|
|