Skip to content

build: add rust-toolchain.toml file#5128

Open
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:smooth-nightly
Open

build: add rust-toolchain.toml file#5128
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:smooth-nightly

Conversation

@dybucc
Copy link
Copy Markdown
Contributor

@dybucc dybucc commented May 31, 2026

Description

At present, one is either required to already have the nightly toolchain set as default in their
rustup set up, or otherwise configure a manual override with rustup override set. This makes it so
that stuff like autoformatting through rustfmt fails, as the .rustfmt.toml file is configured
with unstable features.

This commit adds a rust-toolchain.toml file that makes it so that the user will be reported as
requiring to add the corresponding component when calling, among others, cargo fmt, or otherwise
will silently perform the operation by switching to the nightly channel.

Because this has some slight consequences to some CI jobs, this patch includes changes there as
well.

Note it may be preferable to also add a list of components to make a single failed cargo command
automtically install all components the libc crate requires, but I've left that out for the time
being.

Sources

None

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot rustbot added A-CI Area: CI-related items S-waiting-on-review labels May 31, 2026
Previously, one would have to manually set an override in `rustup` for
the `libc` repo if they weren't already using `nightly` as their default
toolchain channel. This meant stuff that relies on unstable features
like our `.rustfmt.toml` config would not work in those cases.

Adding a `rust-toolchain.toml` should fix this by either automatically
switching users to the `nightly` channel, or triggering a `rustup
install` if their installation does not yet include it.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 4, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: CI-related items S-waiting-on-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants