2026-07-29 04:40 UTC
Replies (2)
-
@idkrn@infosec.exchange 2026-07-29 16:52
@bugaevc@floss.social yes I was using C as an example since I was assuming the reason the post exists in the first place was because of fil c. I don’t entirely agree with the initial post, but unwrap() isn’t the same as forgetting that something can be null. In this case you’re specifying you want a panic. You can basically replace every unwrap() with ?
-
@bugaevc@floss.social 2026-07-29 04:41
@idkrn@infosec.exchange It's not specific to Rust, or any other language: you think some invariant will hold (index will be in bounds, a value would be there), and if at runtime it doesn't, you controllably crash (panic, throw an exception) so that at least you don't go into the UB territory and maintain "safety". Without complex and unpractical formal verification schemes, this can not be eliminated.