Cargo has a number of special filenames that it recognizes during the build process. For example, build.rs provides build instructions, lib.rs/main.rs are entry points, and mod.rs is a module. I’d like to avoid accidentally naming my modules something that might be treated specially, or that might be misinterpreted as being treated specially.
Is there a complete listing of all the “special” filenames that Cargo recognizes?
There is a good overview in the cargo book.
.
├── Cargo.lock
├── Cargo.toml
├── src/
│ ├── lib.rs
│ ├── main.rs
│ └── bin/
│ ├── named-executable.rs
│ ├── another-executable.rs
│ └── multi-file-executable/
│ ├── main.rs
│ └── some_module.rs
├── benches/
│ ├── large-input.rs
│ └── multi-file-bench/
│ ├── main.rs
│ └── bench_module.rs
├── examples/
│ ├── simple.rs
│ └── multi-file-example/
│ ├── main.rs
│ └── ex_module.rs
└── tests/
├── some-integration-tests.rs
└── multi-file-test/
├── main.rs
└── test_module.rs
But all of those are just defaults and you can change them via settings in the Cargo.toml
file.
build.rs
shouldn't ever clash with modules since it lives in the root rather than under src/
I don't think mod.rs
is cargo specific but rather how rust modules are defined.