Usage of crate not defined in toml file

In this file file, author is using crate named test, but I checked the toml file, I don’t see any crate named after test. From where is this thing imported?

It comes from a sysroot: rustc makes crates in $(rustc --print sysroot)/lib automatically available. std and core work that way. There’s a bunch of other crates in sysroot, but they are all hidden behind a feature flag.

feature(test) at the top of that file enables the test crate.

3 Likes