error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> src/lib.rs:9:9
|
9 | Self::foo();
| ^^^^^^^^^ doesn't have a size known at compile-time
|
note: required by a bound in `Trait::foo`
--> src/lib.rs:4:15
|
2 | fn foo()
| --- required by a bound in this
3 | where
4 | Self: Sized,
| ^^^^^ required by this bound in `Trait::foo`
help: consider further restricting `Self`
|
8 | fn bar(&self) where Self: Sized {
| +++++++++++++++++
Is there a specific reason we don't allow calling a non-object-safe method from within an object-safe one within the trait? I think it should be possible; we will always know the concrete type within the implementation of the trait. Do I miss something?
error[E0277]: the trait bound `Self: Clone` is not satisfied
--> src/lib.rs:9:9
|
9 | Self::foo();
| ^^^^^^^^^ the trait `Clone` is not implemented for `Self`
|
note: required by a bound in `Trait::foo`
--> src/lib.rs:4:15
|
2 | fn foo()
| --- required by a bound in this
3 | where
4 | Self: Clone,
| ^^^^^ required by this bound in `Trait::foo`
help: consider further restricting `Self`
|
8 | fn bar(&self) where Self: Clone {
| +++++++++++++++++