Silence Compiler Warnings

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