eddyb

u/eddyb


r/rust•

env RUSTFLAGS="-Funsafe-code --cap-lints=warn" cargo check -vv --message-format=json-diagnostic-rendered-ansi 2>/dev/null | egrep '^\{' | jq -r 'select(.message?.code?.code? == "unsafe_code").message?.rendered?'

You may also want to use a temporary CARGO_TARGET_DIR that you remove afterwards, to both prevent Cargo from having to rebuild all your deps when using normal cargo check, and to re-print all the warnings every time you run the command.

And/or wrap this in something caching the results (presumably some of the Cargo messages tell you which crates are not getting rebuilt because they haven't changed).

A Rust program like cargo-geiger could use this method with very little

5336