rust/src/test/ui/illegal-sized-bound/mutability-mismatch.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
768 B
Plaintext
Raw Normal View History

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