3 ms·
I won't be able to explain this succinctly. Sorry to be an asshole, but you are in Plato's cave of only having monomorphized types. The point of erased types i
by Ericson2314 3y ago
I won't be able to explain this succinctly. Sorry to be an asshole, but you are in Plato's cave of only having monomorphized types.
The point of erased types is to be able to put in the language invariants that hitherto are only in our heads, but unless you have a typed-based mental model for what makes vtables/dictionaries safe (say, based on experience in other languages) you won't have ideas you can't write down, and thus you won't know what is missing.
I wish there was a good blog-sized resource I could point you to that did explain it instead, but I don't know of any off-hand.
I guess, try to wrote `dyn Trait` things (like a heterogenous collection) without `dyn Trait`, and then when it doesn't work without unsafe Rust, you will see what I mean.