Closed
Description
rustdoc
doesn't show that some traits require the type to be sized, which can get a bit misleading.
For example, the docs for std::default::Default
(https://doc.rust-lang.org/std/default/trait.Default.html) show
pub trait Default {
pub fn default() -> Self;
}
While in reality it is actually
pub trait Default: Sized {
/* Docs and stabilization attributes */
fn default() -> Self;
}
When looking at a trait definition, rust
assumes that the type the trait will be implemented for is ?Sized
, so dropping Sized
is incorrect.