Working on some issue and pull request triage for the Rust book yesterday, I ended up learning about cargo test -- --help and visiting the rustc book for the first time ever — 9½ years into using the language! (I’m not the only one who had never seen the latter!)
The cargo test -- --test thing gets filed under the small but exceptionally annoying category “basically-undiscoverable things in Rust”. It turns out that cargo test --help will show you help options for cargo test but not for the test binary cargo test invokes; cargo test -- --help shows you those. It’s documented… barely, and not obviously! The test binary itself is mentioned briefly in The Rust Programming Language, but only really documented in the rustc book.
To be fair, the help output does say:
Run
cargo test -- --helpfor test binary options.
But there’s no indication there of what “test binary” means. There’s no way to know when that’s the thing you ought to ask!
Now, again, to be fair: this kind of discoverability is a very difficult problem to solve.
My general takeaway here is it’s a really weird distinction that (a) has a good reason to exist, because it is important that the test binary, like rustc itself, be able to be invoked by tools which are not cargo but (b) is nonetheless a significant negative for folks trying to learn their tools!
I’m trying something new: call it macro-microblogging? Basically, the kind of quick notes I see from Tom Macwright or Simon Willison. Not quite microblogging, but quick, short notes of the same sort I post to Bluesky etc. — unpolished, just notes on things I hit during the day, so that they can be useful to folks reading along via this site! Let me know what you think.