Skip to content

Reject unknown rust-toolchain.toml keys#4956

Closed
Bortlesboat wants to merge 1 commit into
rust-lang:mainfrom
Bortlesboat:fix/2876-unknown-toolchain-keys
Closed

Reject unknown rust-toolchain.toml keys#4956
Bortlesboat wants to merge 1 commit into
rust-lang:mainfrom
Bortlesboat:fix/2876-unknown-toolchain-keys

Conversation

@Bortlesboat

Copy link
Copy Markdown

Reject unknown keys at both levels of rust-toolchain.toml deserialization.

This prevents misspellings such as channnel = "nightly" from being silently ignored and also rejects unsupported top-level sections. The TOML parser reports the unknown key and lists the supported fields, while valid and legacy toolchain files retain their existing behavior.

Fixes #2876.

Validation:

  • RED/GREEN tests for an unknown [toolchain] key and an unknown top-level section
  • all 13 config::tests parser tests pass with the test feature
  • cargo clippy --all-targets --features test -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

I also attempted the broader --all-features Clippy command. On this Windows host its optional vendored-OpenSSL lane requires a perl executable and stopped while configuring OpenSSL; the repository's normal Windows feature set above is green.

@djc

djc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

There already was a PR for this before you claimed it:

@djc djc closed this Jul 13, 2026
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.

Unknown keys in rust-toolchain.toml are silently ignored

2 participants