@@ -392,8 +392,7 @@ mod desc {
392392 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`" ;
393393 pub const parse_unpretty: & str = "`string` or `string=string`" ;
394394 pub const parse_treat_err_as_bug: & str = "either no value or a non-negative number" ;
395- pub const parse_trait_solver: & str =
396- "one of the supported solver modes (`classic`, `next`, or `next-coherence`)" ;
395+ pub const parse_new_solver_config: & str = "a comma separated list of solver configurations: `globally` (default), `coherence`, `dump-tree`, `dump-tree-on-error" ;
397396 pub const parse_lto: & str =
398397 "either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted" ;
399398 pub const parse_linker_plugin_lto: & str =
@@ -425,7 +424,6 @@ mod desc {
425424 "a `,` separated combination of `bti`, `b-key`, `pac-ret`, or `leaf`" ;
426425 pub const parse_proc_macro_execution_strategy: & str =
427426 "one of supported execution strategies (`same-thread`, or `cross-thread`)" ;
428- pub const parse_dump_solver_proof_tree: & str = "one of: `always`, `on-request`, `on-error`" ;
429427 pub const parse_remap_path_scope: & str = "comma separated list of scopes: `macro`, `diagnostics`, `unsplit-debuginfo`, `split-debuginfo`, `split-debuginfo-path`, `object`, `all`" ;
430428 pub const parse_inlining_threshold: & str =
431429 "either a boolean (`yes`, `no`, `on`, `off`, etc), or a non-negative number" ;
@@ -1028,15 +1026,48 @@ mod parse {
10281026 }
10291027 }
10301028
1031- pub ( crate ) fn parse_trait_solver ( slot : & mut TraitSolver , v : Option < & str > ) -> bool {
1032- match v {
1033- Some ( "classic" ) => * slot = TraitSolver :: Classic ,
1034- Some ( "next" ) => * slot = TraitSolver :: Next ,
1035- Some ( "next-coherence" ) => * slot = TraitSolver :: NextCoherence ,
1036- // default trait solver is subject to change..
1037- Some ( "default" ) => * slot = TraitSolver :: Classic ,
1038- _ => return false ,
1029+ pub ( crate ) fn parse_new_solver_config (
1030+ slot : & mut Option < NextSolverConfig > ,
1031+ v : Option < & str > ,
1032+ ) -> bool {
1033+ if let Some ( config) = v {
1034+ let mut coherence = false ;
1035+ let mut globally = true ;
1036+ let mut dump_tree = None ;
1037+ for c in config. split ( ',' ) {
1038+ match c {
1039+ "globally" => globally = true ,
1040+ "coherence" => {
1041+ globally = false ;
1042+ coherence = true ;
1043+ }
1044+ "dump-tree" => {
1045+ if dump_tree. replace ( DumpSolverProofTree :: Always ) . is_some ( ) {
1046+ return false ;
1047+ }
1048+ }
1049+ "dump-tree-on-error" => {
1050+ if dump_tree. replace ( DumpSolverProofTree :: OnError ) . is_some ( ) {
1051+ return false ;
1052+ }
1053+ }
1054+ _ => return false ,
1055+ }
1056+ }
1057+
1058+ * slot = Some ( NextSolverConfig {
1059+ coherence : coherence || globally,
1060+ globally,
1061+ dump_tree : dump_tree. unwrap_or_default ( ) ,
1062+ } ) ;
1063+ } else {
1064+ * slot = Some ( NextSolverConfig {
1065+ coherence : true ,
1066+ globally : true ,
1067+ dump_tree : Default :: default ( ) ,
1068+ } ) ;
10391069 }
1070+
10401071 true
10411072 }
10421073
@@ -1301,19 +1332,6 @@ mod parse {
13011332 true
13021333 }
13031334
1304- pub ( crate ) fn parse_dump_solver_proof_tree (
1305- slot : & mut DumpSolverProofTree ,
1306- v : Option < & str > ,
1307- ) -> bool {
1308- match v {
1309- None | Some ( "always" ) => * slot = DumpSolverProofTree :: Always ,
1310- Some ( "never" ) => * slot = DumpSolverProofTree :: Never ,
1311- Some ( "on-error" ) => * slot = DumpSolverProofTree :: OnError ,
1312- _ => return false ,
1313- } ;
1314- true
1315- }
1316-
13171335 pub ( crate ) fn parse_inlining_threshold ( slot : & mut InliningThreshold , v : Option < & str > ) -> bool {
13181336 match v {
13191337 Some ( "always" | "yes" ) => {
@@ -1585,9 +1603,6 @@ options! {
15851603 "output statistics about monomorphization collection" ) ,
15861604 dump_mono_stats_format: DumpMonoStatsFormat = ( DumpMonoStatsFormat :: Markdown , parse_dump_mono_stats, [ UNTRACKED ] ,
15871605 "the format to use for -Z dump-mono-stats (`markdown` (default) or `json`)" ) ,
1588- dump_solver_proof_tree: DumpSolverProofTree = ( DumpSolverProofTree :: Never , parse_dump_solver_proof_tree, [ UNTRACKED ] ,
1589- "dump a proof tree for every goal evaluated by the new trait solver. If the flag is specified without any options after it
1590- then it defaults to `always`. If the flag is not specified at all it defaults to `on-request`." ) ,
15911606 dwarf_version: Option <u32 > = ( None , parse_opt_number, [ TRACKED ] ,
15921607 "version of DWARF debug information to emit (default: 2 or 4, depending on platform)" ) ,
15931608 dylib_lto: bool = ( false , parse_bool, [ UNTRACKED ] ,
@@ -1714,6 +1729,8 @@ options! {
17141729 "the size at which the `large_assignments` lint starts to be emitted" ) ,
17151730 mutable_noalias: bool = ( true , parse_bool, [ TRACKED ] ,
17161731 "emit noalias metadata for mutable references (default: yes)" ) ,
1732+ next_solver: Option <NextSolverConfig > = ( None , parse_new_solver_config, [ TRACKED ] ,
1733+ "enable and configure the next generation trait solver used by rustc" ) ,
17171734 nll_facts: bool = ( false , parse_bool, [ UNTRACKED ] ,
17181735 "dump facts from NLL analysis into side files (default: no)" ) ,
17191736 nll_facts_dir: String = ( "nll-facts" . to_string( ) , parse_string, [ UNTRACKED ] ,
@@ -1914,8 +1931,6 @@ written to standard error output)"),
19141931 "for every macro invocation, print its name and arguments (default: no)" ) ,
19151932 track_diagnostics: bool = ( false , parse_bool, [ UNTRACKED ] ,
19161933 "tracks where in rustc a diagnostic was emitted" ) ,
1917- trait_solver: TraitSolver = ( TraitSolver :: Classic , parse_trait_solver, [ TRACKED ] ,
1918- "specify the trait solver mode used by rustc (default: classic)" ) ,
19191934 // Diagnostics are considered side-effects of a query (see `QuerySideEffects`) and are saved
19201935 // alongside query results and changes to translation options can affect diagnostics - so
19211936 // translation options should be tracked.
0 commit comments