Skip to content

Commit 6d3a912

Browse files
committed
Auto merge of #12182 - Muscraft:sort-unstable-z-flags, r=epage
chore: Lexicographically order `-Z` flags When looking at [`unstable_cli_options!`](https://github.com/rust-lang/cargo/blob/6ec9649372a3d03958d15e96bdbf078ee50a2a71/src/cargo/core/features.rs#L693), I noticed a comment about keeping the list ["lexicographically ordered"](https://github.com/rust-lang/cargo/blob/6ec9649372a3d03958d15e96bdbf078ee50a2a71/src/cargo/core/features.rs#L699), and saw that it wasn't ordered correctly. This PR orders the list of unstable features within [`unstable_cli_options!`](https://github.com/rust-lang/cargo/blob/6ec9649372a3d03958d15e96bdbf078ee50a2a71/src/cargo/core/features.rs#L693) lexicographically. To review this PR, it would probably be easiest to read the list [from my branch](https://github.com/Muscraft/cargo/blob/765e8867893f1083152a67a1c447408e3458c90e/src/cargo/core/features.rs#L693).
2 parents 6ec9649 + 765e886 commit 6d3a912

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Diff for: src/cargo/core/features.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -696,42 +696,42 @@ unstable_cli_options!(
696696
print_im_a_teapot: bool = (HIDDEN),
697697

698698
// All other unstable features.
699-
// Please keep this list lexiographically ordered.
699+
// Please keep this list lexicographically ordered.
700700
advanced_env: bool = (HIDDEN),
701701
avoid_dev_deps: bool = ("Avoid installing dev-dependencies if possible"),
702702
binary_dep_depinfo: bool = ("Track changes to dependency artifacts"),
703703
bindeps: bool = ("Allow Cargo packages to depend on bin, cdylib, and staticlib crates, and use the artifacts built by those crates"),
704704
#[serde(deserialize_with = "deserialize_build_std")]
705705
build_std: Option<Vec<String>> = ("Enable Cargo to compile the standard library itself as part of a crate graph compilation"),
706706
build_std_features: Option<Vec<String>> = ("Configure features enabled for the standard library itself when building the standard library"),
707+
#[serde(deserialize_with = "deserialize_check_cfg")]
708+
check_cfg: Option<(/*features:*/ bool, /*well_known_names:*/ bool, /*well_known_values:*/ bool, /*output:*/ bool)> = ("Specify scope of compile-time checking of `cfg` names/values"),
707709
codegen_backend: bool = ("Enable the `codegen-backend` option in profiles in .cargo/config.toml file"),
708710
config_include: bool = ("Enable the `include` key in config files"),
709711
credential_process: bool = ("Add a config setting to fetch registry authentication tokens by calling an external process"),
710-
#[serde(deserialize_with = "deserialize_check_cfg")]
711-
check_cfg: Option<(/*features:*/ bool, /*well_known_names:*/ bool, /*well_known_values:*/ bool, /*output:*/ bool)> = ("Specify scope of compile-time checking of `cfg` names/values"),
712+
direct_minimal_versions: bool = ("Resolve minimal dependency versions instead of maximum (direct dependencies only)"),
712713
doctest_in_workspace: bool = ("Compile doctests with paths relative to the workspace root"),
713714
doctest_xcompile: bool = ("Compile and run doctests for non-host target using runner config"),
714715
dual_proc_macros: bool = ("Build proc-macros for both the host and the target"),
715716
features: Option<Vec<String>> = (HIDDEN),
716717
gitoxide: Option<GitoxideFeatures> = ("Use gitoxide for the given git interactions, or all of them if no argument is given"),
718+
host_config: bool = ("Enable the [host] section in the .cargo/config.toml file"),
717719
jobserver_per_rustc: bool = (HIDDEN),
720+
lints: bool = ("Pass `[lints]` to the linting tools"),
718721
minimal_versions: bool = ("Resolve minimal dependency versions instead of maximum"),
719-
direct_minimal_versions: bool = ("Resolve minimal dependency versions instead of maximum (direct dependencies only)"),
722+
msrv_policy: bool = ("Enable rust-version aware policy within cargo"),
720723
mtime_on_use: bool = ("Configure Cargo to update the mtime of used files"),
721724
no_index_update: bool = ("Do not update the registry index even if the cache is outdated"),
722725
panic_abort_tests: bool = ("Enable support to run tests with -Cpanic=abort"),
723726
profile_rustflags: bool = ("Enable the `rustflags` option in profiles in .cargo/config.toml file"),
724-
host_config: bool = ("Enable the [host] section in the .cargo/config.toml file"),
727+
publish_timeout: bool = ("Enable the `publish.timeout` key in .cargo/config.toml file"),
725728
registry_auth: bool = ("Authentication for alternative registries, and generate registry authentication tokens using asymmetric cryptography"),
726-
target_applies_to_host: bool = ("Enable the `target-applies-to-host` key in the .cargo/config.toml file"),
727729
rustdoc_map: bool = ("Allow passing external documentation mappings to rustdoc"),
730+
rustdoc_scrape_examples: bool = ("Allows Rustdoc to scrape code examples from reverse-dependencies"),
728731
separate_nightlies: bool = (HIDDEN),
729-
publish_timeout: bool = ("Enable the `publish.timeout` key in .cargo/config.toml file"),
730-
unstable_options: bool = ("Allow the usage of unstable options"),
731732
skip_rustdoc_fingerprint: bool = (HIDDEN),
732-
rustdoc_scrape_examples: bool = ("Allows Rustdoc to scrape code examples from reverse-dependencies"),
733-
msrv_policy: bool = ("Enable rust-version aware policy within cargo"),
734-
lints: bool = ("Pass `[lints]` to the linting tools"),
733+
target_applies_to_host: bool = ("Enable the `target-applies-to-host` key in the .cargo/config.toml file"),
734+
unstable_options: bool = ("Allow the usage of unstable options"),
735735
);
736736

737737
const STABILIZED_COMPILE_PROGRESS: &str = "The progress bar is now always \

0 commit comments

Comments
 (0)