An Unofficial Guide to Using Rustc


#1

A week or so ago @dobkeratops posted a question about searching crates by unsafety or traits which prompted me to look into using rustc's internals for analysing and manipulating a crate. A lot of these compiler internals are pretty undocumented and continually evolving, so I ended up sifting through lots of source code for rustc, as well as clippy, and other similar projects.

To make it easier for others to take advantage of rustc for analysing and manipulating Rust programs, I’ve started writing up “An Unofficial Guide to Using Rustc”. This is a small tutorial which explores building tools on top of rustc through the creation of a cargo metrics subcommand.

It’s still very much a Work In Progress but I thought I’d put it out there so others can check it out and provide feedback.

(rendered/repo)