Warnings only appear when Rust recompiles your files; however, it caches as much as possible, and if something has not changed, it will gladly skip the useless compilation. There is currently no option in Cargo to force recovery.
, , touch , Cargo , :
$ cd /path/to/project/root
$ ls
Cargo.lock Cargo.toml src target
$ cargo build
Compiling abc v0.1.0 (file:///private/tmp/b/abc)
src/main.rs:2:9: 2:10 warning: unused variable: 'x', #[warn(unused_variables)] on by default
src/main.rs:2 let x: u8 = 123;
^
$ cargo build
$ touch $(find src)
$ cargo build
Compiling abc v0.1.0 (file:///private/tmp/b/abc)
src/main.rs:2:9: 2:10 warning: unused variable: 'x', #[warn(unused_variables)] on by default
src/main.rs:2 let x: u8 = 123;
^
, , , target , , cargo clean:
$ cargo build
Compiling abc v0.1.0 (file:///private/tmp/b/abc)
src/main.rs:2:9: 2:10 warning: unused variable: 'x', #[warn(unused_variables)] on by default
src/main.rs:2 let x: u8 = 123;
^
$ cargo build
$ cargo clean
$ cargo build
Compiling abc v0.1.0 (file:///private/tmp/b/abc)
src/main.rs:2:9: 2:10 warning: unused variable: 'x', #[warn(unused_variables)] on by default
src/main.rs:2 let x: u8 = 123;
^
Vim , ! , , .