Chapter 21: top, an empty file with a job
This is the shortest chapter, about the shortest file in the repository.
lib.rs in here is empty, and it has to exist.
Chapter 19's Cargo.toml is a list of dependencies, but cargo and reindeer
only accept a list of dependencies if it belongs to a package, and a
package must have something to build. So the manifest declares one:
[package]
name = "rust-third-party"
[lib]
path = "top/lib.rs"
and this is that something. Nothing compiles it into anything that runs, and nothing depends on it. It is a doorstop: the door is the whole third-party graph, and it stays open because this is wedged under it.
Aside. The same trick turns up wherever Rust is built by something other than cargo: a stand-in top-level crate whose only purpose is to hold the dependency list. reindeer's own examples name theirs
toptoo.
Try it.
wc -c third-party/rust/top/lib.rsprints0, andgrep -n top third-party/rust/Cargo.tomlshows the one line that needs it.
For the people who maintain it
In this folder
| Path | What |
|---|---|
| lib.rs | Empty, on purpose. |
| README.md | This chapter. |
| CLAUDE.md | Leave it alone, for agents. |
← Previous: Chapter 20, fixups/ · Up: rust · Next: Chapter 22, research/ →