Skip to content
Select theme

Debugging, docs and tooling

The tools around Rust are good and rarely documented in one place: dbg! when you cannot be bothered with a debugger, RUST_BACKTRACE=1 when something panics deep inside a crate, cargo clippy and rustfmt in CI.

It ends with compile times, because that is the one thing everyone complains about and almost nobody measures.

Nothing published in this chapter yet — all 14 articles are still to come.

Coming up (14)
  • How to debug without a debuggerdbg!, and the value it prints for you
  • How to read a stack trace from a panicRUST_BACKTRACE, and the frames that matter
  • How to debug Rust with VS CodeCodeLLDB, breakpoints, and pretty printers
  • How to see what a macro expanded tocargo expand, and the code you never wrote
  • How to format code with rustfmtthe config file, and what not to fight
  • How to lint code with clippycargo clippy, and the extra lints worth turning on
  • How to fix the most common clippy warningsten lints, with the fix for each
  • How to speed up compile timesmeasure first, then the five changes that work
  • How to rerun on savecargo watch, without the noise
  • How to write doc comments///, //!, and the sections rustdoc expects
  • How to generate documentationcargo doc, and the private items nobody sees
  • What is rustdoc, and how do doc links work?intra-doc links, and the broken ones
  • How to check a project in CIthe three commands, in the right order
  • What tools should every Rust developer use?the ten that earn their place