Silence Compiler Warnings #
cargo rustc -- -Awarnings
This command allows you to compile your Rust code while adjusting the compilerโs behavior towards warnings. The rustc
part of the command tells Cargo to pass subsequent arguments directly to the Rust compiler. The -- -Awarnings
part is an argument to rustc
that sets the warning level to โallowโ, effectively silencing all compiler warnings. This can be useful in a development setting where youโre aware of existing warnings and want to focus on writing new code.
You can also use RUSTFLAGS="-Awarnings"
but it will recompile everything.
$env:RUSTFLAGS="-Awarnings"; cargo run