@@ -382,6 +382,8 @@ mod desc {
382382 "`all` (default), `except-unused-generics`, `except-unused-functions`, or `off`" ;
383383 pub const parse_unpretty: & str = "`string` or `string=string`" ;
384384 pub const parse_treat_err_as_bug: & str = "either no value or a number bigger than 0" ;
385+ pub const parse_trait_solver: & str =
386+ "one of the supported solver modes (`stock`, `chalk`, or `next`)" ;
385387 pub const parse_lto: & str =
386388 "either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted" ;
387389 pub const parse_linker_plugin_lto: & str =
@@ -880,6 +882,16 @@ mod parse {
880882 }
881883 }
882884
885+ pub ( crate ) fn parse_trait_solver ( slot : & mut TraitSolver , v : Option < & str > ) -> bool {
886+ match v {
887+ Some ( "stock" ) => * slot = TraitSolver :: Stock ,
888+ Some ( "chalk" ) => * slot = TraitSolver :: Chalk ,
889+ Some ( "next" ) => * slot = TraitSolver :: Next ,
890+ _ => return false ,
891+ }
892+ true
893+ }
894+
883895 pub ( crate ) fn parse_lto ( slot : & mut LtoCli , v : Option < & str > ) -> bool {
884896 if v. is_some ( ) {
885897 let mut bool_arg = None ;
@@ -1249,8 +1261,6 @@ options! {
12491261 "instrument control-flow architecture protection" ) ,
12501262 cgu_partitioning_strategy: Option <String > = ( None , parse_opt_string, [ TRACKED ] ,
12511263 "the codegen unit partitioning strategy to use" ) ,
1252- chalk: bool = ( false , parse_bool, [ TRACKED ] ,
1253- "enable the experimental Chalk-based trait solving engine" ) ,
12541264 codegen_backend: Option <String > = ( None , parse_opt_string, [ TRACKED ] ,
12551265 "the backend to use" ) ,
12561266 combine_cgu: bool = ( false , parse_bool, [ TRACKED ] ,
@@ -1609,6 +1619,8 @@ options! {
16091619 "for every macro invocation, print its name and arguments (default: no)" ) ,
16101620 track_diagnostics: bool = ( false , parse_bool, [ UNTRACKED ] ,
16111621 "tracks where in rustc a diagnostic was emitted" ) ,
1622+ trait_solver: TraitSolver = ( TraitSolver :: Stock , parse_trait_solver, [ TRACKED ] ,
1623+ "specify the trait solver mode used by rustc (default: stock)" ) ,
16121624 // Diagnostics are considered side-effects of a query (see `QuerySideEffects`) and are saved
16131625 // alongside query results and changes to translation options can affect diagnostics - so
16141626 // translation options should be tracked.
0 commit comments