Mehdi Akiki

A practical Rust reference

Symptom → mechanism → evidence

Rust Failure Atlas

A field guide for Rust failures that are difficult to name and easy to misdiagnose. Start from what you can observe, isolate the mechanism, reproduce it, and verify the repair.

The front of this page collects failures below the application layer: an FFI symbol that disappears under LTO, a linker killed for memory, a sys crate that finds the wrong native library, two copies of one native library in one binary, a C object built for the host instead of the target, memory freed by the wrong allocator, and a doctest that sees a different cfg. The full collection, including compiler diagnostics with a stable error code, stays searchable below and on the family pages.

704

symptom-first records

689

records with a downloadable failing and repaired fixture; 15 link to articles without an executable fixture yet

99

mechanism trails connecting related failures

Below the application layer

These 27 cases depend on more than the source file: the final link, a symbol table, a C toolchain, the target triple, the allocator on the other side of an FFI call, a Cargo profile, or the test harness. For 16 of them the fixture goes past a single compiler run: nm and readelf, a link map, a linker under a memory cap, a C host built with AddressSanitizer, paired Cargo profiles, or a subprocess deadline.

What the final artifact actually exports, which symbols survive LTO, and what the linker needs to finish.

Which native library a build script finds, who owns it in the graph, and which machine its objects are built for.

Which side owns an allocation, what a value means on the other side of the boundary, and what a panic may cross.

When Cargo reruns a build script, what a profile changes, and how doctests and packaging see a different crate.

Timers, blocking work, wakeups, shared test processes, and layout decisions that only show up when the program runs.

01

Begin with the symptom

Use the exact message, target, timing, profile, and smallest environmental difference you can observe.

02

Run a discriminating check

Prefer one test that separates two possible causes over a long list of generic fixes.

03

Keep the fixture with the repair

Each case page ships a failing and a repaired fixture. The fixture shows that the failure reproduces and that the repair passes. The explanation is written by hand, and you can check it against the fixture.

Find the failure you actually have

Search error fragments and observed behavior. The first check is deliberately narrow: it should remove a branch from the diagnosis, not merely produce more logs.

Inclusion standard

A plausible explanation is not yet a case file

I include a failure when I can state the symptom without pretending it has only one cause, show a minimal or controlled reproduction, identify at least one misleading shortcut, and connect the repair to evidence that would fail again if the mechanism returned.

A fixture run shows two things: the failing project fails with the recorded output, and the repaired project passes. It does not check the written explanation, which is my reading of the mechanism with primary sources cited on each case page. 15 records link to long-form articles instead of case pages. They do not have an executable fixture yet, and search results say so.

  • Exact toolchain, target, profile, and dependency context
  • Small reproduction or controlled interleaving
  • Likely cause separated from confirmed cause
  • A repair with a regression check
  • Primary documentation or upstream implementation source
  • A review date when version-sensitive behavior matters

Reference layer

Compiler diagnostics and library contracts

The other 677 records are the reference layer. Most of them start from a compiler diagnostic or a documented standard library contract, where the cause is closer to the code you wrote: borrow and trait errors, macro and type diagnostics, collection and I/O behavior, numeric edge cases, and edition changes. 322 of them are keyed to a compiler error code. All of them stay in search and on their family pages.

A case belongs in the atlas when copying the final fix without understanding the mechanism is likely to make the failure return in another target, task, dependency, or release. For language concepts without a failure symptom, use the Rust Under the Hood series. For a compiler error code on its own, the official Rust error-code index is usually the faster reference.

Add evidence, not noise

Have a Rust failure that disappears when simplified?

Send the smallest evidence you still trust: the symptom, versions, target, profile, and what makes it appear or disappear. A useful report can become an Atlas case without exposing private source code.

Share a reproducible symptom