| ▲ | aw1621107 3 hours ago | |||||||
> It should be limited to use in `unsafe` blocks. That would be a fairly significant expansion of what `unsafe` means in Rust, to put it lightly. Not to mention that I think doing so would not really accomplish anything; marking unwrap() `unsafe` would not "surface `unwrap` usage" or "make any guarantees", as it's perfectly fine for safe functions to contain `unsafe` blocks with zero indication of such in the function signature and. | ||||||||
| ▲ | echelon 3 hours ago | parent [-] | |||||||
> fairly significant expansion of what `unsafe` means in Rust I want an expansion of panic free behavior. We'll never get all the way there due to allocations etc., but this is the class of error the language is intended to fix. This turned into a null pointer, which is exactly what Rust is supposed to quench. I'll go as far as saying I would like to statically guarantee none of my dependencies use the unwrap() methods. We should be able to design libraries that provably avoid panics to the greatest extent possible. Unwrap is an easy loss on a technicality. | ||||||||
| ||||||||