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

Restricting unwrap to unsafe blocks adds negative value to the language. It won't prevent unwrap mistakes (people who play fast and loose with it today will just switch to "foo = unsafe { bar.unwrap() };" instead). And it'll muddy the purpose of unsafe by adding in a use that has nothing to do with memory safety. It's not a good idea.


> And it'll muddy the purpose of unsafe by adding in a use that has nothing to do with memory safety.

Then we need more safety semantics around panic behavior. A panic label or annotation that infects every call.

Moreover, I want a way of statically guaranteeing none of my dependencies do this.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: