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

I think one can argue make_slice is in fact at fault here since it's unsound (i.e., it doesn't enforce the requirements of from_raw_parts() and so allows safe code to invoke UB) and therefore either should be marked unsafe or should actually enforce the requirements of from_raw_parts().

That being said, I think in this context that's more of a nitpick since you're right in stating that bugs that result in UB need not be scoped strictly to unsafe blocks.



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

Search: