@@ -396,8 +396,7 @@ mod desc {
396396 pub const parse_instrument_xray: & str = "either a boolean (`yes`, `no`, `on`, `off`, etc), or a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit`" ;
397397 pub const parse_unpretty: & str = "`string` or `string=string`" ;
398398 pub const parse_treat_err_as_bug: & str = "either no value or a non-negative number" ;
399- pub const parse_trait_solver: & str =
400- "one of the supported solver modes (`classic`, `next`, or `next-coherence`)" ;
399+ pub const parse_next_solver_config: & str = "a comma separated list of solver configurations: `globally` (default), `coherence`, `dump-tree`, `dump-tree-on-error" ;
401400 pub const parse_lto: & str =
402401 "either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted" ;
403402 pub const parse_linker_plugin_lto: & str =
@@ -429,7 +428,6 @@ mod desc {
429428 "a `,` separated combination of `bti`, `b-key`, `pac-ret`, or `leaf`" ;
430429 pub const parse_proc_macro_execution_strategy: & str =
431430 "one of supported execution strategies (`same-thread`, or `cross-thread`)" ;
432- pub const parse_dump_solver_proof_tree: & str = "one of: `always`, `on-request`, `on-error`" ;
433431 pub const parse_remap_path_scope: & str = "comma separated list of scopes: `macro`, `diagnostics`, `unsplit-debuginfo`, `split-debuginfo`, `split-debuginfo-path`, `object`, `all`" ;
434432 pub const parse_inlining_threshold: & str =
435433 "either a boolean (`yes`, `no`, `on`, `off`, etc), or a non-negative number" ;
@@ -1032,15 +1030,48 @@ mod parse {
10321030 }
10331031 }
10341032
1035- pub ( crate ) fn parse_trait_solver ( slot : & mut TraitSolver , v : Option < & str > ) -> bool {
1036- match v {
1037- Some ( "classic" ) => * slot = TraitSolver :: Classic ,
1038- Some ( "next" ) => * slot = TraitSolver :: Next ,
1039- Some ( "next-coherence" ) => * slot = TraitSolver :: NextCoherence ,
1040- // default trait solver is subject to change..
1041- Some ( "default" ) => * slot = TraitSolver :: Classic ,
1042- _ => return false ,
1033+ pub ( crate ) fn parse_next_solver_config (
1034+ slot : & mut Option < NextSolverConfig > ,
1035+ v : Option < & str > ,
1036+ ) -> bool {
1037+ if let Some ( config) = v {
1038+ let mut coherence = false ;
1039+ let mut globally = true ;
1040+ let mut dump_tree = None ;
1041+ for c in config. split ( ',' ) {
1042+ match c {
1043+ "globally" => globally = true ,
1044+ "coherence" => {
1045+ globally = false ;
1046+ coherence = true ;
1047+ }
1048+ "dump-tree" => {
1049+ if dump_tree. replace ( DumpSolverProofTree :: Always ) . is_some ( ) {
1050+ return false ;
1051+ }
1052+ }
1053+ "dump-tree-on-error" => {
1054+ if dump_tree. replace ( DumpSolverProofTree :: OnError ) . is_some ( ) {
1055+ return false ;
1056+ }
1057+ }
1058+ _ => return false ,
1059+ }
1060+ }
1061+
1062+ * slot = Some ( NextSolverConfig {
1063+ coherence : coherence || globally,
1064+ globally,
1065+ dump_tree : dump_tree. unwrap_or_default ( ) ,
1066+ } ) ;
1067+ } else {
1068+ * slot = Some ( NextSolverConfig {
1069+ coherence : true ,
1070+ globally : true ,
1071+ dump_tree : Default :: default ( ) ,
1072+ } ) ;
10431073 }
1074+
10441075 true
10451076 }
10461077
@@ -1305,19 +1336,6 @@ mod parse {
13051336 true
13061337 }
13071338
1308- pub ( crate ) fn parse_dump_solver_proof_tree (
1309- slot : & mut DumpSolverProofTree ,
1310- v : Option < & str > ,
1311- ) -> bool {
1312- match v {
1313- None | Some ( "always" ) => * slot = DumpSolverProofTree :: Always ,
1314- Some ( "never" ) => * slot = DumpSolverProofTree :: Never ,
1315- Some ( "on-error" ) => * slot = DumpSolverProofTree :: OnError ,
1316- _ => return false ,
1317- } ;
1318- true
1319- }
1320-
13211339 pub ( crate ) fn parse_inlining_threshold ( slot : & mut InliningThreshold , v : Option < & str > ) -> bool {
13221340 match v {
13231341 Some ( "always" | "yes" ) => {
@@ -1591,9 +1609,6 @@ options! {
15911609 "output statistics about monomorphization collection" ) ,
15921610 dump_mono_stats_format: DumpMonoStatsFormat = ( DumpMonoStatsFormat :: Markdown , parse_dump_mono_stats, [ UNTRACKED ] ,
15931611 "the format to use for -Z dump-mono-stats (`markdown` (default) or `json`)" ) ,
1594- dump_solver_proof_tree: DumpSolverProofTree = ( DumpSolverProofTree :: Never , parse_dump_solver_proof_tree, [ UNTRACKED ] ,
1595- "dump a proof tree for every goal evaluated by the new trait solver. If the flag is specified without any options after it
1596- then it defaults to `always`. If the flag is not specified at all it defaults to `on-request`." ) ,
15971612 dwarf_version: Option <u32 > = ( None , parse_opt_number, [ TRACKED ] ,
15981613 "version of DWARF debug information to emit (default: 2 or 4, depending on platform)" ) ,
15991614 dylib_lto: bool = ( false , parse_bool, [ UNTRACKED ] ,
@@ -1722,6 +1737,8 @@ options! {
17221737 "the size at which the `large_assignments` lint starts to be emitted" ) ,
17231738 mutable_noalias: bool = ( true , parse_bool, [ TRACKED ] ,
17241739 "emit noalias metadata for mutable references (default: yes)" ) ,
1740+ next_solver: Option <NextSolverConfig > = ( None , parse_next_solver_config, [ TRACKED ] ,
1741+ "enable and configure the next generation trait solver used by rustc" ) ,
17251742 nll_facts: bool = ( false , parse_bool, [ UNTRACKED ] ,
17261743 "dump facts from NLL analysis into side files (default: no)" ) ,
17271744 nll_facts_dir: String = ( "nll-facts" . to_string( ) , parse_string, [ UNTRACKED ] ,
@@ -1922,8 +1939,6 @@ written to standard error output)"),
19221939 "for every macro invocation, print its name and arguments (default: no)" ) ,
19231940 track_diagnostics: bool = ( false , parse_bool, [ UNTRACKED ] ,
19241941 "tracks where in rustc a diagnostic was emitted" ) ,
1925- trait_solver: TraitSolver = ( TraitSolver :: Classic , parse_trait_solver, [ TRACKED ] ,
1926- "specify the trait solver mode used by rustc (default: classic)" ) ,
19271942 // Diagnostics are considered side-effects of a query (see `QuerySideEffects`) and are saved
19281943 // alongside query results and changes to translation options can affect diagnostics - so
19291944 // translation options should be tracked.
0 commit comments