-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #8393 - ludumipsum:unstable_flags_in_config, r=alexcric…
…hton Allow configuring unstable flags via config file # Summary This fixes #8127 by mapping the `unstable` key in `.cargo/config` to Z flags. It should have no impact on stable/beta cargo, and on nightlies it gives folks the ability to configure Z flags for an entire project or workspace. This is meant to make it easier to try things like the [new features resolver](#8088) behavior, mtime-on-use, build-std, or timing reports across a whole project. I've also included a small (but entirely independent) ergonomics change -- treating dashes and underscores identically in Z flags. That's along for the ride in this PR as the last commit, and is included here because it makes for more idiomatic toml file keys (`print_im_a_teapot = yes` vs `print-im-a-teapot = yes`). Please let me know if y'all would prefer that be in a separate PR, or not happen at all. # Test Plan Apologies if I've missed anything -- this is my first cargo contrib and I've tried to hew to the contributing guide. If I've slipped up, please let me know how and I'll fix it. NB. My linux machine doesn't have multilib set up, so I disabled cross tests. * `cargo test` passes for each commit in the stack * I formatted each commit in the stack with `rustfmt` * New tests are included alongside the relevant change for each change * I've validated each test by locally undoing the code change they support and confirming failure. * The CLI wins, for both enable and disabling Z flags, as you'd expect. Keys in `unstable` which do not correspond with a Z flag will trigger an error indicating the invalid flag came from a config file read: ``` Invalid [unstable] entry in Cargo config Caused by: unknown `-Z` flag specified: an-invalid-flag ``` If you'd like to see a test case which isn't represented here, I'm happy to add it. Just let me know. # Documentation I've included commits in this stack updating the only docs page that seemed relevant to me, skimming the book -- `unstable.md`.
- Loading branch information
Showing
7 changed files
with
246 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters