Closed
Description
Problem
When setting lto = true
in the dev profile, Cargo will rebuild all dependencies when switching between cargo build
to cargo build --tests
(and vice-versa).
Steps
- Check out https://github.com/jonas-schievink/cargo-lto-bug
- Run
cargo build
- Run
cargo build --tests
- Observe that Cargo rebuild the
bitflags
dependency
Notes
Output of cargo version
: cargo 1.46.0 (149022b1d 2020-07-17)
Also happens on the current nightly, which is cargo 1.47.0-nightly (51b66125b 2020-08-19)