Skip to content

internal: support RUSTFMT_TOOLCHAIN for xtask codegen#22074

Merged
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
A4-Tacks:xtask-rsfmt-toolchain
Apr 17, 2026
Merged

internal: support RUSTFMT_TOOLCHAIN for xtask codegen#22074
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
A4-Tacks:xtask-rsfmt-toolchain

Conversation

@A4-Tacks

Copy link
Copy Markdown
Member

No description provided.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 17, 2026

@ChayimFriedman2 ChayimFriedman2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems fine to me.

View changes since this review

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 17, 2026
Merged via the queue into rust-lang:master with commit 8edb111 Apr 17, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 17, 2026
@A4-Tacks A4-Tacks deleted the xtask-rsfmt-toolchain branch April 17, 2026 12:26
Comment thread xtask/src/codegen.rs
let sh = Shell::new().unwrap();
let rustfmt_toml = project_root().join("rustfmt.toml");
let version = cmd!(sh, "rustup run stable rustfmt --version").read().unwrap_or_default();
let toolchain = &std::env::var("RUSTFMT_TOOLCHAIN").unwrap_or("stable".to_owned());

@Veykril Veykril Apr 17, 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.

What is this env var? I never heard of that, if anything we should allow RUSTFMT I think, as that is also how RUSTC and CARGO env vars tend to be

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I haven't investigated the source of this variable,
I just hope a temporary variable like UPDATE_EXPECT can be used to adjust the toolchain

Because I only use nightly, I want to run RUSTFMT_TOOLCHAIN=nightly cargo codegen

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants