@@ -734,6 +734,7 @@ unstable_cli_options!(
734
734
doctest_xcompile: bool = ( "Compile and run doctests for non-host target using runner config" ) ,
735
735
dual_proc_macros: bool = ( "Build proc-macros for both the host and the target" ) ,
736
736
features: Option <Vec <String >> = ( HIDDEN ) ,
737
+ gc: bool = ( "Track cache usage and \" garbage collect\" unused files" ) ,
737
738
gitoxide: Option <GitoxideFeatures > = ( "Use gitoxide for the given git interactions, or all of them if no argument is given" ) ,
738
739
host_config: bool = ( "Enable the [host] section in the .cargo/config.toml file" ) ,
739
740
lints: bool = ( "Pass `[lints]` to the linting tools" ) ,
@@ -1105,6 +1106,7 @@ impl CliUnstable {
1105
1106
"direct-minimal-versions" => self . direct_minimal_versions = parse_empty ( k, v) ?,
1106
1107
"doctest-xcompile" => self . doctest_xcompile = parse_empty ( k, v) ?,
1107
1108
"dual-proc-macros" => self . dual_proc_macros = parse_empty ( k, v) ?,
1109
+ "gc" => self . gc = parse_empty ( k, v) ?,
1108
1110
"gitoxide" => {
1109
1111
self . gitoxide = v. map_or_else (
1110
1112
|| Ok ( Some ( GitoxideFeatures :: all ( ) ) ) ,
@@ -1139,7 +1141,17 @@ impl CliUnstable {
1139
1141
/// Generates an error if `-Z unstable-options` was not used for a new,
1140
1142
/// unstable command-line flag.
1141
1143
pub fn fail_if_stable_opt ( & self , flag : & str , issue : u32 ) -> CargoResult < ( ) > {
1142
- if !self . unstable_options {
1144
+ self . fail_if_stable_opt_custom_z ( flag, issue, "unstable-options" , self . unstable_options )
1145
+ }
1146
+
1147
+ pub fn fail_if_stable_opt_custom_z (
1148
+ & self ,
1149
+ flag : & str ,
1150
+ issue : u32 ,
1151
+ z_name : & str ,
1152
+ enabled : bool ,
1153
+ ) -> CargoResult < ( ) > {
1154
+ if !enabled {
1143
1155
let see = format ! (
1144
1156
"See https://github.com/rust-lang/cargo/issues/{issue} for more \
1145
1157
information about the `{flag}` flag."
@@ -1148,7 +1160,7 @@ impl CliUnstable {
1148
1160
let channel = channel ( ) ;
1149
1161
if channel == "nightly" || channel == "dev" {
1150
1162
bail ! (
1151
- "the `{flag}` flag is unstable, pass `-Z unstable-options ` to enable it\n \
1163
+ "the `{flag}` flag is unstable, pass `-Z {z_name} ` to enable it\n \
1152
1164
{see}"
1153
1165
) ;
1154
1166
} else {
0 commit comments