30 releases

0.11.6 Mar 31, 2023
0.11.4 Aug 1, 2022
0.11.3 May 19, 2022
0.11.2 Jan 6, 2022
0.4.0 Jul 23, 2018

#110 in Cargo plugins

Download history 89/week @ 2023-08-17 123/week @ 2023-08-24 99/week @ 2023-08-31 128/week @ 2023-09-07 113/week @ 2023-09-14 104/week @ 2023-09-21 76/week @ 2023-09-28 77/week @ 2023-10-05 73/week @ 2023-10-12 69/week @ 2023-10-19 111/week @ 2023-10-26 93/week @ 2023-11-02 145/week @ 2023-11-09 70/week @ 2023-11-16 185/week @ 2023-11-23 151/week @ 2023-11-30

563 downloads per month


6.5K SLoC

cargo-geiger ☢️

Build Status unsafe forbidden Code Coverage crates.io Crates.io

A tool that lists statistics related to the usage of unsafe Rust code in a Rust crate and all its dependencies.

This cargo plugin was originally based on the code from two other projects:


Try to find and use a system-wide installed OpenSSL library:

cargo install cargo-geiger

Or, build and statically link OpenSSL as part of the cargo-geiger executable:

cargo install cargo-geiger --features vendored-openssl


  1. Navigate to the same directory as the Cargo.toml you want to analyze.
  2. cargo geiger

Intended Use

This tool is not meant to advise directly whether the code ultimately is truly insecure or not.

The purpose of cargo-geiger is to provide statistical input to auditing e.g. with:

The use of unsafe is nuanced and necessary in some cases and any motivation to use it is outside the scope of cargo-geiger.

It is important that any reporting is handled with care:

Output example

Example output

Known issues


Cargo Geiger exposes three libraries:

  • cargo-geiger - Unversioned and highly unstable library exposing the internals of the cargo-geiger binary. As such, any function contained within this library may be subject to change.
  • cargo-geiger-serde - A library containing the serializable report types
  • geiger - A library containing a few decoupled cargo components used by cargo-geiger


See the changelog.

Why the name?


Unsafe code, like ionizing radiation, is unavoidable in some situations and should be safely contained!


~1M SLoC