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

Lifetimes for a function signature in Rust are never inferred from the function code. Rather Rust has implicit lifetime specs with straightforward rules to recover the explicit full signature.


I was speaking about variance specifically. They are not inferred from function bodies, but I think it's fair to say that it's a soft violation of the golden rule because variance has a lot of spooky action at a distance (changing a struct definition can change its variance requirements, which then has ripple effects over all type signatures that mention that struct)




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

Search: