Type validation: `type X = T` vs `let x: T`
⚓ Rust 📅 2025-05-16 👤 surdeus 👁️ 10Just a tiny curious bit: how come
type Tp = (u8, [str]);
doesn't alarm the compiler, yet
let tp: &(u8, [str]);
fails immediately with
// the size for values of type `str` cannot be known at compilation time
// the trait `Sized` is not implemented for `str`
// slice and array elements must have `Sized` type
Are the type and/or use declarations auto-deferred?
1 post - 1 participant
🏷️ rust_feed