zerocopy: Prevent panics statically

Issues like #200 demonstrate that the compiler is sometimes not smart enough to optimize out panics that we can prove statically won’t happen. It would be good if we could:

  • Refactor to only use operations which don’t include panicking in their call graph
  • Validate this in CI

See also #325, #1125

Mentoring instructions

  • Easy steps
    • Create a new step in this CI job that runs Red Pen on zerocopy, only running the step under if: matrix.crate == 'zerocopy' && matrix.toolchain == 'nightly'
    • Annotate as many functions as possible with #[redpen::dont_panic]
  • Medium to hard (depending on the code): Refactor as much code as possible to remove all panics

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 22 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Awesome, thanks! I’ll assign it to you. Feel free to comment here if you have any questions.