Wouter, embedded software consultant · Tweede golf · October 27, 2026

We often get asked "How can I eliminate panics in my Rust code?" There have been several attempts to tackle this issue. Under the Open Device Partnership and working together with Microsoft, we have developed and released the Call Graph Analyzer (CGA), a tool to extract the callgraph from monomorphized MIR. This callgraph can be used to track down what functions in the compiled binary can panic.

For example, when you run cargo cga check on your code, you get:

error: call to method `core::num::<impl u64>::strict_sub` which can panic
  --> src/main.rs:18:17
   |
18 |         let _ = 2u64.strict_sub(u64::MAX);
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^