@@ -392,8 +392,7 @@ mod desc {
392
392
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`" ;
393
393
pub const parse_unpretty: & str = "`string` or `string=string`" ;
394
394
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" ;
397
396
pub const parse_lto: & str =
398
397
"either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted" ;
399
398
pub const parse_linker_plugin_lto: & str =
@@ -425,7 +424,6 @@ mod desc {
425
424
"a `,` separated combination of `bti`, `b-key`, `pac-ret`, or `leaf`" ;
426
425
pub const parse_proc_macro_execution_strategy: & str =
427
426
"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`" ;
429
427
pub const parse_remap_path_scope: & str = "comma separated list of scopes: `macro`, `diagnostics`, `unsplit-debuginfo`, `split-debuginfo`, `split-debuginfo-path`, `object`, `all`" ;
430
428
pub const parse_inlining_threshold: & str =
431
429
"either a boolean (`yes`, `no`, `on`, `off`, etc), or a non-negative number" ;
@@ -1028,15 +1026,48 @@ mod parse {
1028
1026
}
1029
1027
}
1030
1028
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
+ } ) ;
1039
1069
}
1070
+
1040
1071
true
1041
1072
}
1042
1073
@@ -1301,19 +1332,6 @@ mod parse {
1301
1332
true
1302
1333
}
1303
1334
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
-
1317
1335
pub ( crate ) fn parse_inlining_threshold ( slot : & mut InliningThreshold , v : Option < & str > ) -> bool {
1318
1336
match v {
1319
1337
Some ( "always" | "yes" ) => {
@@ -1585,9 +1603,6 @@ options! {
1585
1603
"output statistics about monomorphization collection" ) ,
1586
1604
dump_mono_stats_format: DumpMonoStatsFormat = ( DumpMonoStatsFormat :: Markdown , parse_dump_mono_stats, [ UNTRACKED ] ,
1587
1605
"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`." ) ,
1591
1606
dwarf_version: Option <u32 > = ( None , parse_opt_number, [ TRACKED ] ,
1592
1607
"version of DWARF debug information to emit (default: 2 or 4, depending on platform)" ) ,
1593
1608
dylib_lto: bool = ( false , parse_bool, [ UNTRACKED ] ,
@@ -1714,6 +1729,8 @@ options! {
1714
1729
"the size at which the `large_assignments` lint starts to be emitted" ) ,
1715
1730
mutable_noalias: bool = ( true , parse_bool, [ TRACKED ] ,
1716
1731
"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" ) ,
1717
1734
nll_facts: bool = ( false , parse_bool, [ UNTRACKED ] ,
1718
1735
"dump facts from NLL analysis into side files (default: no)" ) ,
1719
1736
nll_facts_dir: String = ( "nll-facts" . to_string( ) , parse_string, [ UNTRACKED ] ,
@@ -1914,8 +1931,6 @@ written to standard error output)"),
1914
1931
"for every macro invocation, print its name and arguments (default: no)" ) ,
1915
1932
track_diagnostics: bool = ( false , parse_bool, [ UNTRACKED ] ,
1916
1933
"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)" ) ,
1919
1934
// Diagnostics are considered side-effects of a query (see `QuerySideEffects`) and are saved
1920
1935
// alongside query results and changes to translation options can affect diagnostics - so
1921
1936
// translation options should be tracked.
0 commit comments