A method marked where Self: Sized
on a trait should not be considered during object safety checks
#22031
Labels
A-trait-system
Area: Trait system
Because trait objects are never
Sized
, a method markedwhere Self: Sized
does not have to be implemented on an unsized type (although that’s not currently the case in manual impls due to #20021), so the automaticimpl Trait for Trait
should also not have to implement the method (and thus should be ignored during object safety checks).Example:
I’m not very sure if a change like this would require an amendment to the object safety RFC or not, and thus whether this issue belongs in rust-lang/rfcs or here. I’m treating this as a bug because it seems to me that trait
Foo
is in fact object safe, whereas the compiler says otherwise.The text was updated successfully, but these errors were encountered: