Skip to content

fix: warn about unknown toolchain file keys#4969

Open
ychampion wants to merge 1 commit into
rust-lang:mainfrom
ychampion:warn/toolchain-file-unknown-keys
Open

fix: warn about unknown toolchain file keys#4969
ychampion wants to merge 1 commit into
rust-lang:mainfrom
ychampion:warn/toolchain-file-unknown-keys

Conversation

@ychampion

Copy link
Copy Markdown
Contributor

Summary

  • warn with the exact ignored key path when a toolchain file contains unknown settings
  • preserve current parsing behavior while avoiding duplicate warnings from repeated reads
  • document the warning-first transition

Why

Unknown settings can be misspellings, but rejecting them immediately would break toolchain files that currently rely on ignored keys. This stages the stricter behavior requested in #4953 without changing current configuration semantics.

Closes #2876

Validation

  • cargo test --features=test --test test_bonanza rust_toolchain_toml_warns_on_unknown_keys
  • cargo test --features=test --lib
  • cargo clippy --all-targets --features=test -- -D warnings
  • cargo fmt --all -- --check
  • mdbook build
  • git diff --check

Constraint: Preserve current behavior during the warning-first migration
Rejected: Immediate rejection | Maintainer requested a compatibility warning before hard errors
Confidence: high
Scope-risk: narrow
Directive: Keep warning paths stable until the hard-error follow-up lands
Tested: targeted integration test, library tests, Clippy, rustfmt, mdBook, diff check
Not-tested: full integration suite
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

1 participant