Is Rust really safe? How to identify functions that can potentially cause panic

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • rustig

    A tool to detect code paths leading to Rust's panic handler

  • There’s the rustig tool (https://github.com/Technolution/rustig) that looks for code paths leading to the panic handler. Not sure if it still works though.

  • findpanics

    Find calls to panic functions in rust executables

  • Try findpanics (https://github.com/philipc/findpanics) instead. It's also unmaintained, but several years more recent.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • rust_fallible_vec

    Fallible allocation support for Rust's Vec

  • Does this or this look so alien that it could never end up in the standard library?

  • fallible_collections

    impl fallible collections in rust, quite as describe in RFC 2116

  • Does this or this look so alien that it could never end up in the standard library?

  • no-panic

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

  • 'Hacks' such as https://github.com/dtolnay/no-panic, https://crates.io/crates/no-panics-whatsoever that ensure any calls to panic handling will result in link errors. Not really reliable in terms of being able to abort instead, but a possible tool.

  • rustls

    A modern TLS library in Rust

  • I believe it is more relevant than you think: servers running in containers, web assembler tasks running in browsers, embedded devices and kernels with total control of the system, all have the ability to do something more sensible than plain out SIGABRT or similar, and in many the case is not that the complete system is falling down. For example RustTLS is looking into allowing fallible allocators and as a pretty general-purpose library that seems like a nice feature. I do wish ulimit -v worked in a sensible manner with applications.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts