Closed
Description
I've got this code
trait Foo {
fn bar(&self) -> Self where Self: Sized;
}
impl Foo for str {
// fn bar(&self) -> Self { unimplemented!() }
}
the error is:
error[E0046]: not all trait items implemented, missing: `bar`
--> src/lib.rs:5:1
However, since str
is not Sized
, i don't think bar
needs to be implemented. if i remove the "//", i'll got:
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> src/lib.rs:6:22
So although this trait fits object safety rules, i still can't implement it for unsized types.