# Cargo and rustc versions

**URL:** <https://internals.rust-lang.org/t/cargo-and-rustc-versions/12747>\
**Category:** Uncategorized\
**Created:** [July 16, 2020, 1:08pm UTC](https://internals.rust-lang.org/t/cargo-and-rustc-versions/12747 "2020-07-16T13:08:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisd](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/chrisd/32/7232_2.png) [@chrisd](https://internals.rust-lang.org/u/chrisd)\
**Post date:** [July 16, 2020, 1:08pm UTC](https://internals.rust-lang.org/t/cargo-and-rustc-versions/12747/1 "2020-07-16T13:08:06Z")

</div>

Do rustc and cargo versions need to match up? I mean, can I use the latest cargo binary with a very old version of rustc?

I'm thinking in terms of packaging the two. Will mismatched versions cause issues for users?

---

<div class="post-metadata">

**Author:** ![kinnison](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/kinnison/32/5768_2.png) [@kinnison](https://internals.rust-lang.org/u/kinnison)\
**Post date:** [July 16, 2020, 1:39pm UTC](https://internals.rust-lang.org/t/cargo-and-rustc-versions/12747/2 "2020-07-16T13:39:14Z")

</div>

In general you want to keep all the tooling together. Rust's release channels do this for you. If you want to package the rust tooling in some other fashion, I'd suggest starting from the mechanisms we already have for producing the channels.

---

<div class="post-metadata">

**Author:** ![withoutboats](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/withoutboats/32/4560_2.png) [@withoutboats](https://internals.rust-lang.org/u/withoutboats)\
**Post date:** [July 16, 2020, 1:44pm UTC](https://internals.rust-lang.org/t/cargo-and-rustc-versions/12747/3 "2020-07-16T13:44:02Z")

</div>

We do not guarantee that cargo will work correctly with any version of rustc other than the one it is paired with. For example, cargo may use command line flags that don't exist in previous versions of rustc.

---

<div class="post-metadata">

**Author:** ![steffahn](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/steffahn/32/13288_2.png) [@steffahn](https://internals.rust-lang.org/u/steffahn)\
**Post date:** [July 16, 2020, 3:18pm UTC](https://internals.rust-lang.org/t/cargo-and-rustc-versions/12747/4 "2020-07-16T15:18:12Z")

</div>

There is a tool, `cargo-bisect-rustc` that does by default use a current cargo with an old rustc _(it also has a flag to make it also download the corresponding old cargo versions)._ From my experience this (i.e. using new cargo with older rustc) tends to work for all `rustc` versions that are new enough to support the flag for outputting the error messages in JSON format. With versions of `rustc` that don’t have that flag, current `cargo` does not work (_ **at all** _), so that is, with – IIRC – `rustc` that is (at least) 2 or 3 years old or so. Hence, depending on your definition of “very old version of rustc” the answer may be that it _does_ cause issues.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [October 14, 2020, 3:18pm UTC](https://internals.rust-lang.org/t/cargo-and-rustc-versions/12747/5 "2020-10-14T15:18:12Z")

</div>

Closed on October 14, 2020, 3:18pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
