cargo-edit icon indicating copy to clipboard operation
cargo-edit copied to clipboard

`cargo upgrade` is bumping dependencies incompatible with specified rust version

Open jaques-sam-tlv opened this issue 1 month ago • 1 comments

First things first, this is a great tool!!

My version is:

❯ cargo upgrade --version
cargo-edit-upgrade 0.13.8

Just having issues with the cargo upgrade command in a repository where we can't use a higher rust version than 1.82.

Our toolchain (rust-toolchain.toml) file looks like this:

[toolchain]
channel = "1.82.0"

When executing: cargo upgrade and afterwards run the tests, we get:

❯ cargo test
error: rustc 1.82.0 is not supported by the following packages:
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
  [email protected] requires rustc 1.83
Either upgrade rustc or select compatible dependency versions with
`cargo update <name>@<current-ver> --precise <compatible-ver>`
where `<compatible-ver>` is the latest version supporting rustc 1.82.0

This doesn't help either: cargo upgrade --rust-version 1.82.0

This feels like a bug, the packages are clearly saying 1.82 is not supported, yet it's updating them. Thanks for looking into it!

jaques-sam-tlv avatar Nov 27 '25 15:11 jaques-sam-tlv

Do you have reproduction steps?

epage avatar Dec 01 '25 16:12 epage