-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deserialization of check-cfg in config.toml #10799
Fix deserialization of check-cfg in config.toml #10799
Conversation
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
Thanks!
TOML can support tuples. I think the underlying issue is that the Config deserializer doesn't support tuples with anything except strings (particularly to handle environment variables), and we just have never encountered a situation where anything else was needed. This looks good, though. Setting it with booleans would be kinda strange. @bors r+ |
@bors ping |
😪 I'm awake I'm awake |
@bors r+ |
📌 Commit 23f59d4 has been approved by |
☀️ Test successful - checks-actions |
Update cargo 9 commits in dbff32b27893b899ae2397f3d56d1be111041d56..c0bbd42ce5e83fe2a93e817c3f9b955492d3130a 2022-06-24 19:25:13 +0000 to 2022-07-03 13:41:11 +0000 - fix typo (rust-lang/cargo#10818) - fix(add): Don't panic with `--offline` (rust-lang/cargo#10817) - chore: Set permissions for GitHub actions (rust-lang/cargo#10816) - Bump to 0.65.0, update changelog (rust-lang/cargo#10812) - Fix zsh completions for add and locate-project (rust-lang/cargo#10810) - Bump cargo-util version. (rust-lang/cargo#10804) - Update os_info (rust-lang/cargo#10802) - Fix deserialization of check-cfg in config.toml (rust-lang/cargo#10799) - fix: bash complete `install --path` with dirs (rust-lang/cargo#10798)
When improving the check-cfg implementation in #10566 I changed the internal representation of
check_cfg
from multiplebool
options to oneOption<(bool, bool, bool, bool)>
but I didn't realize until rust-lang/rust#82450 (comment) that the internal representation is actually somewhat public as it's used in the[unstable]
in.cargo/config.toml
.And because TOML cannot represent tuples there is no way to set it from the
[unstable]
section. This PR fix this oversight by using a custom deserializer method similar to what was already done forbuild-std
.