Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rather, any language with both generics and subtyping needs to consider variance, and Rust doesn't have subtyping in general, but lifetimes do technically have subtyping relationships, so lifetimes are the only place where this matters, and fortunately Rust can just infer the right behavior based on some simple type-level heuristics.


Unfortunately, more like. I'd much rather have some explicit syntax for it that potentially never realise it's a feature. I was baffled beyond belief the first time the compiler asked me to put a ghost in my struct.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: