@@ -396,8 +396,7 @@ mod desc {
396
396
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`" ;
397
397
pub const parse_unpretty: & str = "`string` or `string=string`" ;
398
398
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" ;
401
400
pub const parse_lto: & str =
402
401
"either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted" ;
403
402
pub const parse_linker_plugin_lto: & str =
@@ -429,7 +428,6 @@ mod desc {
429
428
"a `,` separated combination of `bti`, `b-key`, `pac-ret`, or `leaf`" ;
430
429
pub const parse_proc_macro_execution_strategy: & str =
431
430
"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`" ;
433
431
pub const parse_remap_path_scope: & str = "comma separated list of scopes: `macro`, `diagnostics`, `unsplit-debuginfo`, `split-debuginfo`, `split-debuginfo-path`, `object`, `all`" ;
434
432
pub const parse_inlining_threshold: & str =
435
433
"either a boolean (`yes`, `no`, `on`, `off`, etc), or a non-negative number" ;
@@ -1032,15 +1030,48 @@ mod parse {
1032
1030
}
1033
1031
}
1034
1032
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
+ } ) ;
1043
1073
}
1074
+
1044
1075
true
1045
1076
}
1046
1077
@@ -1305,19 +1336,6 @@ mod parse {
1305
1336
true
1306
1337
}
1307
1338
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
-
1321
1339
pub ( crate ) fn parse_inlining_threshold ( slot : & mut InliningThreshold , v : Option < & str > ) -> bool {
1322
1340
match v {
1323
1341
Some ( "always" | "yes" ) => {
@@ -1591,9 +1609,6 @@ options! {
1591
1609
"output statistics about monomorphization collection" ) ,
1592
1610
dump_mono_stats_format: DumpMonoStatsFormat = ( DumpMonoStatsFormat :: Markdown , parse_dump_mono_stats, [ UNTRACKED ] ,
1593
1611
"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`." ) ,
1597
1612
dwarf_version: Option <u32 > = ( None , parse_opt_number, [ TRACKED ] ,
1598
1613
"version of DWARF debug information to emit (default: 2 or 4, depending on platform)" ) ,
1599
1614
dylib_lto: bool = ( false , parse_bool, [ UNTRACKED ] ,
@@ -1722,6 +1737,8 @@ options! {
1722
1737
"the size at which the `large_assignments` lint starts to be emitted" ) ,
1723
1738
mutable_noalias: bool = ( true , parse_bool, [ TRACKED ] ,
1724
1739
"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" ) ,
1725
1742
nll_facts: bool = ( false , parse_bool, [ UNTRACKED ] ,
1726
1743
"dump facts from NLL analysis into side files (default: no)" ) ,
1727
1744
nll_facts_dir: String = ( "nll-facts" . to_string( ) , parse_string, [ UNTRACKED ] ,
@@ -1922,8 +1939,6 @@ written to standard error output)"),
1922
1939
"for every macro invocation, print its name and arguments (default: no)" ) ,
1923
1940
track_diagnostics: bool = ( false , parse_bool, [ UNTRACKED ] ,
1924
1941
"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)" ) ,
1927
1942
// Diagnostics are considered side-effects of a query (see `QuerySideEffects`) and are saved
1928
1943
// alongside query results and changes to translation options can affect diagnostics - so
1929
1944
// translation options should be tracked.
0 commit comments