# dtolnay/no-panic

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

Repository: https://github.com/dtolnay/no-panic
Canonical: https://ross.abutalabs.com/products/no-panic
Language: Rust
License: Apache-2.0
License Family: permissive
Last push: 2026-08-03T04:45:15+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 81, longevity 100
- inputs: {"age_days": 2952, "days_push": 30, "days_rel": 46, "gap_med": 48.5, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1214, forks 20 (observed 2026-08-28T04:04:00.857396+00:00)

## What it is
A Rust attribute macro that makes the compiler prove at link time that a marked function can never panic, failing compilation with a linker error naming the offending function otherwise. It is a lightweight proc-macro crate published on crates.io by dtolnay.

## Use cases
- guarantee a function cannot panic in Rust
- catch potential panics at compile time
- verify no-panic safety of parsing or slicing code
- hardening embedded or safety-critical Rust code
- detect panics in release builds via linker errors

## When to choose
- you need static, link-time proof that specific Rust functions are panic-free
- you are building release binaries and can tolerate debug-mode compile issues
- your build uses panic = "unwind" and invokes a linker

## When to avoid
- you rely on cargo check or library-only builds, which skip linking and thus panic detection
- your code is built with panic = "abort"
- you need const functions or debug-mode compilation of optimization-dependent functions

## Facets
- artifact type: library
- maturity: stable
- function: testing, error-handling, developer-tools
- domain: developer-tools, programming-languages, performance
- platform: rust, cross-platform
- tags: attribute-macro, panic-detection, link-time-verification, rust-proc-macro

## Member repositories
- dtolnay/no-panic (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:00.857396+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:17:21.631665+00:00, confidence not recorded.
  - readme: https://github.com/dtolnay/no-panic (fetched 2026-08-28T04:04:00.857396+00:00, sha 82d7c2f66a12)
  - registry_crates: https://crates.io/api/v1/crates/no-panic (fetched 2026-08-29T12:25:20.260508+00:00, sha d0174438d448)
- Data as of 2026-08-30T08:39:29.467469+00:00.
