The Sized trait in Rust marks types with a known size at compile time, which is required for most values to be stored on the stack. By default, generic types are implicitly bounded by Sized, but you can opt out of this requirement using the ?Sized syntax to allow unsized types like slices or trait objects.
fn generic<T: Sized>(t: T) {
// T has a known size at compile time
}
fn generic_maybe_sized<T: ?Sized>(t: &T) {
// T can be unsized, so we take a reference
}