sled
sled copied to clipboard
panic reduction
gradually apply https://github.com/dtolnay/no-panic to a new test feature that just compiles optimized code and asserts that panic does not happen in a wider and wider subtree.
biggest offenders for panics right now:
- TryFrom/TryInto errors - can be converted to ReportableBug errors
- array indexing errors - same as above
- result/option unwrap errors - can add try_unwrap that returns Err(ReportableBug) on failure
- assertions - can be disabled with the no panic feature
Panic-free Drop implementations might be a good intermediate goal, as a second panic during unwinding will abort
@divergentdave I agree, that seems like one of the best places to start. The first module I started playing with is the serialization module, which has turned out to be a bit of work, but not necessarily challenging, and pretty important for overall safety.