What is the purpose of the rustfmt tool?
It is an automatic formatter that ensures your code follows the standard Rust community style.
How does a Rust macro differ fundamentally from a function?
Macros are used to write code that generates other code, and they do not always follow the same rules as functions.
What command is used to manually compile a Rust source file?
rustc filename.rs
What is the immediate output of a successful Rust compilation?
A binary executable file.
What does it mean that Rust is an ahead-of-time compiled language?
You can compile a program and give the executable to someone else, and they can run it without having Rust installed.
What is the purpose of the .pdb file on Windows?
It contains debugging information used by development tools.
Why might you use Cargo instead of rustc as your project grows?
Cargo helps manage complex project options, dependencies, and makes it easier to share code.
What is the command to create a new project using Cargo?
cargo new project_name
In a Cargo project, where does the source code (like main.rs) live?
Inside the src directory.
What does the Cargo.toml file do?
It is the configuration file for the project, written in TOML format.
What does TOML stand for?
Tom’s Obvious, Minimal Language.
What is the purpose of the [package] section in Cargo.toml?
It contains configuration metadata needed to compile the program, such as the name, version, and edition.
Where do you list the external crates your project needs in Cargo.toml?
Under the [dependencies] section.
What is the main difference between the top-level directory and the src directory?
The top-level is for configuration, READMEs, and licenses; src is strictly for source code.
What command compiles a Cargo project?
cargo build
Where does Cargo store the executable file by default?
In the target/debug/ directory.
Why do developers use cargo check instead of cargo build during development?
It is much faster because it verifies the code compiles without the time-consuming step of producing an executable.
What is the purpose of the Cargo.lock file?
It keeps track of the exact versions of dependencies to ensure builds are reproducible.
Who (or what) is responsible for managing the contents of Cargo.lock?
Cargo (users should not edit this file manually).
What happens if you run cargo run and the source code hasn’t changed since the last build?
Cargo skips the compilation step and runs the existing binary immediately.
What is the primary benefit of the target/debug/ folder in the root directory for binaries?
It keeps the project root clean and organizes build artifacts separately from source code.
What is the prelude in Rust?
A set of items defined in the standard library that Rust automatically brings into the scope of every program.
Which library provides features for accepting user input?
The std::io library.
Where can you find a complete list of everything included in the prelude?
In the official Rust standard library documentation.