Skip to content

Commit 53e46db

Browse files
Add chalk flag back with removal error
1 parent 3b33649 commit 53e46db

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

compiler/rustc_session/src/options.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ type OptionSetter<O> = fn(&mut O, v: Option<&str>) -> Result<(), ParseError>;
306306

307307
pub enum ParseError {
308308
Invalid,
309+
Removed(&'static str),
309310
}
310311

311312
type OptionDescrs<O> = &'static [(&'static str, OptionSetter<O>, &'static str, &'static str)];
@@ -343,6 +344,10 @@ fn build_options<O: Default>(
343344
),
344345
),
345346
},
347+
Err(ParseError::Removed(in_favor_of)) => early_error(
348+
error_format,
349+
&format!("{outputname} option `{key}` removed in favor of `{in_favor_of}`"),
350+
),
346351
},
347352
None => early_error(error_format, &format!("unknown {outputname} option: `{key}`")),
348353
}
@@ -388,6 +393,7 @@ mod desc {
388393
pub const parse_treat_err_as_bug: &str = "either no value or a number bigger than 0";
389394
pub const parse_trait_solver: &str =
390395
"one of the supported solver modes (`classic`, `chalk`, or `next`)";
396+
pub const parse_chalk: &str = "";
391397
pub const parse_lto: &str =
392398
"either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted";
393399
pub const parse_linker_plugin_lto: &str =
@@ -955,6 +961,10 @@ mod parse {
955961
Ok(())
956962
}
957963

964+
pub(crate) fn parse_chalk(_slot: &mut (), _v: Option<&str>) -> Result<(), ParseError> {
965+
Err(ParseError::Removed("-Z trait-solver=chalk"))
966+
}
967+
958968
pub(crate) fn parse_lto(slot: &mut LtoCli, v: Option<&str>) -> Result<(), ParseError> {
959969
if v.is_some() {
960970
let mut bool_arg = None;
@@ -1351,6 +1361,8 @@ options! {
13511361
"instrument control-flow architecture protection"),
13521362
cgu_partitioning_strategy: Option<String> = (None, parse_opt_string, [TRACKED],
13531363
"the codegen unit partitioning strategy to use"),
1364+
chalk: () = ((), parse_chalk, [UNTRACKED],
1365+
"enable chalk solver -- deprecated, use `-Z trait-solver=chalk`"),
13541366
codegen_backend: Option<String> = (None, parse_opt_string, [TRACKED],
13551367
"the backend to use"),
13561368
combine_cgu: bool = (false, parse_bool, [TRACKED],

tests/rustdoc-ui/z-help.stdout

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
-Z branch-protection=val -- set options for branch target identification and pointer authentication on AArch64
99
-Z cf-protection=val -- instrument control-flow architecture protection
1010
-Z cgu-partitioning-strategy=val -- the codegen unit partitioning strategy to use
11+
-Z chalk=val -- enable chalk solver -- deprecated, use `-Z trait-solver=chalk`
1112
-Z codegen-backend=val -- the backend to use
1213
-Z combine-cgu=val -- combine CGUs into a single one
1314
-Z crate-attr=val -- inject the given attribute in the crate

0 commit comments

Comments
 (0)