Hacker GitHub

← All repos

dtolnay/no-panic

View on GitHub ↗ ★ 1,221 Rust

Attribute macro to require that the compiler prove a function can't ever panic

11 mentions on Hacker News by 9 people: 1 story, 10 comments · first 2021-02-19 · latest 2025-11-19

Mentions per year 11 mentions · busiest year 2025 (4)
20082026
  1. …leave something to be desired, so a first-party solution would probably be preferable. [0]: https://github.com/dtolnay/no-panic
  2. …for a "traditional" dynamically-typed language - Smalltalk, pre-type-hints Python, Lua, etc. [0]: https://github.com/dtolnay/no-panic
  3. Normal rust can already do this. For example #[no_panic] attribute is implemented in https://github.com/dtolnay/no-panic crate.
  4. …with a readable error message, if the optimizer isn't able to eliminate the check. edit: There is https://github.com/dtolnay/no-panic
  5. …IIRC this is being worked on, especially given Linus's position on panics in the kernel. [0]: https://github.com/dtolnay/no-panic
    comment by aw1621107 · 2024-07-22 · in Jiff: Datetime library for Rust
  6. …panic), the program fails to compile with a linker error that identifies the function name. 1: https://github.com/dtolnay/no-panic
    comment by marcus_cemes · 2022-11-13 · in Carefully exploring Rust as a Python developer
  7. …for, to ensure the correctness of stuff type errors can't catch. Now, there are some crates like https://github.com/dtolnay/no-panic or https://github.com/facebookexperimental/MIRAI that will check that your code is panic free. The first…
    comment by nextaccountic · 2022-09-14 · in A pair of Linux kernel modules using Rust
  8. …to prevent them at compile time, and cannot be without major changes to the language (though see https://github.com/dtolnay/no-panic ).
    comment by afdbcreid · 2022-04-07 · in Rust Lang Roadmap for 2024
  9. …wait for an entire effect system, or be valuable enough to add to the compiler as a one-off? [0] https://github.com/dtolnay/no-panic
  10. I found a crate that claims to do #1: https://github.com/dtolnay/no-panic This also looks interesting: https://github.com/Technolution/rustig