Skip to content

Prevent panics statically #202

@joshlf

Description

@joshlf

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

Metadata

Metadata

Assignees

Labels

compatibility-nonbreakingChanges that are (likely to be) non-breakingexperience-easyThis issue is easy, and shouldn't require much experienceexperience-mediumThis issue is of medium difficulty, and requires some experiencehelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions