Skip to content
HN On Hacker News ↗

Finding panics with Call Graph Analyzer — Tweede golf

▲ 73 points • 3 comments • by ndr • 1w ago • HN discussion ↗

Pangram verdict · v3.3

We believe that this entire text is human-written.

0 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 1 of 1
SEGMENTS · AI 0 of 1
WORD COUNT 164
PEAK AI % 0% · §1
Analyzed
Oct 30
backend: pangram/v3.3
Segments scanned
1 windows
avg 164 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 164 words · 1 segments analyzed

Human AI-generated
§1 Human · 0%

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.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); | ^^^^^^^^^^^^^^^^^^^^^^^^^