Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions doc/user-guide/src/concepts/channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ on Rust's train release model. The release schedule is posted to the [Rust
Forge]. `rustup` assists with installing different channels, keeping them
up-to-date, and easily switching between them.

After a release channel has been installed, `rustup` can be used to update the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe just changing rustup to rustup update is enough for clarification.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think it would be useful to explicitly mention that channels are not updated automatically, and that the user has to run rustup update manually if they want to update the channel.

Otherwise even when replacing rustup with rustup update here, there might still be uncertainty. For example a user could assume an automatic update check happens every X weeks, but rustup update forces an update check.
Similar to how rustup self-update works, where rustup self update forces an update check.

installed version to the latest release on that channel. See the [Keeping rust
up to date] section for more information.
When installing from a channel, `rustup` installs the latest release from that
channel at that point of time. Once installed, `rustup` does not automatically
update the channel when new releases become available. Instead,
`rustup update` can be used to update to the latest release of that channel,
see the [Keeping Rust up to date] section for more information.

@json420 json420 Nov 24, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the presence of rustup on your filesystem does not mean there is some process in the background constantly checking for updates and automatically installing them when available. But this isn't desirable behavior or what (I think) most developers would expect anyway.

However, rustup update does exactly what (I believe) you are wanting. If you rustup toolchain install stable when Rust 1.100 is the stable release, and then run rustup update when 1.101 is released, you will get 1.101.

To keep your teams CI in sync, all you need to do is run rustup update prior to the build and you will all be on the same build.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not mean there is some process in the background constantly checking for updates and automatically installing them when available

It might rather be conceivable that similar to how for rust-toolchain.toml it already automatically installs a missing toolchain when invoking cargo ..., it might also perform an update check.
Either way I am not asking for that behavior here in this PR.

My main point is that the user should not have to guess what it means to "install stable / nightly"; the documentation should clearly state that it installs the latest version at that point of time, and then afterwards the user is responsible for updating it manually (through rustup update).


To keep your teams CI in sync, all you need to do is run rustup update prior to the build and you will all be on the same build.

Except this is not guaranteed? You only make sure that this way CI always uses the latest release. But

  • locally on your developer machine you might by accident still run on an older version
  • now CI might break when rebuilding the same commit, just because a new Rust version was released in the meantime1
  • you have now split toolchain configuration into at least 2 places: the rust-toolchain.toml and the CI workflow2

To clarify, I am not saying that fixing such issues is necessarily difficult or much work; maybe just running rustup update locally on your development machine is enough to solve it.
But it is a disruption nonetheless.

And for users who are looking into rust-toolchain.toml to pin to a certain Rust version (which the documentation explicitly mentions as one use case), I think the documentation should point out that channel = "stable" is in fact not actually pinning to a specific version but rather to whatever version CI has pre-installed / cached (if any).3

For example searching for channel = "stable" on GitHub shows multiple cases where a comment says "pin for local and CI", "pinned to stable so versions don't drift", "current stable", "latest stable", and none of this is guaranteed by rust-toolchain.toml itself. Either the comment is just wrong (?) or there is additional setup needed (both locally and for CI) such as rustup update you mentioned.

And especially with Dependabot and Renovate supporting rust-toolchain.toml, it is not that inconvenient anymore to specify an exact version instead of stable.

Footnotes

  1. As mentioned in the doc changes, this might not be a problem in many setups, but it can be for nightly or for build.warnings = "deny". ↩

  2. Or in the worst case into "all CI workflows", because they all need to run rustup update now before they can start. ↩

  3. For example just compare the images on https://github.com/actions/runner-images (as of writing): macos-15: Rust 1.98.0, macos-15-arm64: Rust 1.100.0, xcode-27-arm64: Rust 1.99.1. I am not blaming GitHub here; my point is that relying on the pre-installed stable can make make troubleshooting quite cumbersome. ↩

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my personal experience, if you are looking at using stable then you probably should not put the channel at all (so that beta can be used at the same time, actually this is encouraged by the toolchain teams IIRC)... and when using nightly you almost certainly want to put a particular nightly because nothing on nightly is stable enough for you to pin on "any nightly".

The nightly case has some clear exceptions e.g. for running nightly rustfmt or miri, but I think that'll just be ergonomics improvement and could be covered by something like #4636.

`rustup` can also install specific versions of Rust, such as `1.45.2` or
`nightly-2020-07-27`. See the [Toolchains] chapter for more information on
Expand All @@ -19,7 +21,7 @@ details on switching between toolchains and pinning your project to a specific
toolchain.

[channels]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
[Keeping rust up to date]: ../basics.md#keeping-rust-up-to-date
[Keeping Rust up to date]: ../basics.md#keeping-rust-up-to-date
[rust forge]: https://forge.rust-lang.org/
[toolchains]: toolchains.md

Expand Down
17 changes: 17 additions & 0 deletions doc/user-guide/src/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,24 @@ string in the following form:
<date> = YYYY-MM-DD
```

> [!NOTE]
> When specifying unversioned channels such as `stable` (instead of `1.99.1`)
> or `nightly` (instead of `nightly-2021-01-21`) and that channel is already
> installed locally, `rustup` will use that existing installed release, even
> if a newer release for that channel might be available online.
>
> When collaborating with other people on a project or when running Continuous
> Integration on a separate machine this can lead to different Rust versions
> being used. This is usually not a problem though due to Rust's stability
> guarnatees (and its features such as [Editions] and [Cargo `rust-version`]).\
> However, there are cases where mismatches between Rust versions can lead to
> unexpected build failures, for example when using nightly features or when
> running Continuous Integration with [`build.warnings = "deny"`].
Comment on lines +137 to +143

@rami3l rami3l Nov 25, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we are at it, I'd advise against particularly locking unversioned channels in rust-toolchain.toml... Would that make sense?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I also think specifying an unversioned channel is problematic (though my Rust usage is limited mainly to public library development, so it might not apply to all use cases), but in the above mentioned forum discussion some users did not consider unversioned channels a problem for their use case.

That is why I tried to keep this here rather neutral (and only mention the cases where it is more likely a problem, nightly and build.warnings = "deny").


[toolchain]: concepts/toolchains.md
[Editions]: https://doc.rust-lang.org/edition-guide/editions/
[Cargo `rust-version`]: https://doc.rust-lang.org/cargo/reference/rust-version.html
[`build.warnings = "deny"`]: https://doc.rust-lang.org/cargo/reference/config.html#buildwarnings

#### path

Expand Down
Loading