How can I get Cargo to tell me what content is out of date when building with --locked?

Viewed 659

When building via cargo --locked test, if the Cargo.lock file is out of date you'll get the message:

error: the lock file /home/.../Cargo.lock needs to be updated but --locked was passed to prevent this

Adding --verbose doesn't yield any additional information.

1 Answers

I would:

  1. Perform a build without --locked
  2. Diff the changed Cargo.lock to the one saved in source control.

I might also try a tool like cargo outdated, but this will show all the dependencies that are out of date, not just mismatches between Cargo.toml and Cargo.lock.

Related