What the difference between Cargo.toml and .cargo/config.toml

Viewed 72

I am learning to write a kernel by using Rust.

I added [dependencies] bootloader = "0.9.8" to .cargo/config.toml, but I got an error.

I forgot the specific error, but when I move [dependencies] bootloader = "0.9.8" to Cargo.toml and then run "cargo bootimage" on terminal, everything goes well.

1 Answers

Cargo.toml is where you put everything your project need. Dependencies, project details, project settings etc..

cargo/config.toml is a configuration file for Cargo. You usually don't need to touch it, and it usually uses more advanced things. It can be configured per project, although also globally. It sets for example what commands Cargo will run, what environment variables it will set, etc..

All details about both are in the documentation - Cargo.toml, config.toml.

Related