diff options
| author | Boxy <supbscripter@gmail.com> | 2023-07-03 21:00:10 +0100 |
|---|---|---|
| committer | Boxy <supbscripter@gmail.com> | 2023-07-03 21:00:16 +0100 |
| commit | 040aa58d0a5e35b73c487e395e3d59263de188ff (patch) | |
| tree | 6ee545db70bac74a562b5bc6127c78d088238e70 /compiler/rustc_session/src | |
| parent | 8931edf746da6aa2d86412516d805f5680929a5e (diff) | |
| download | rust-040aa58d0a5e35b73c487e395e3d59263de188ff.tar.gz rust-040aa58d0a5e35b73c487e395e3d59263de188ff.zip | |
add flag for disabling global cache and printing proof trees on error
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/config.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_session/src/options.rs | 20 |
2 files changed, 26 insertions, 2 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 2fe7a6f511b..996e106cf85 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -745,6 +745,14 @@ pub enum TraitSolver { NextCoherence, } +#[derive(Default, Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum SolverProofTreeCondition { + #[default] + Never, + Always, + OnError, +} + pub enum Input { /// Load source code from a file. File(PathBuf), diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 16a4c2a8b3d..e04e1d75287 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -418,6 +418,7 @@ mod desc { "a `,` separated combination of `bti`, `b-key`, `pac-ret`, or `leaf`"; pub const parse_proc_macro_execution_strategy: &str = "one of supported execution strategies (`same-thread`, or `cross-thread`)"; + pub const parse_solver_proof_tree_condition: &str = "one of: `always`, `never`, `on_error`"; } mod parse { @@ -1238,6 +1239,19 @@ mod parse { }; true } + + pub(crate) fn parse_solver_proof_tree_condition( + slot: &mut SolverProofTreeCondition, + v: Option<&str>, + ) -> bool { + match v { + None | Some("always") => *slot = SolverProofTreeCondition::Always, + Some("never") => *slot = SolverProofTreeCondition::Never, + Some("on-error") => *slot = SolverProofTreeCondition::OnError, + _ => return false, + }; + true + } } options! { @@ -1463,8 +1477,10 @@ options! { "output statistics about monomorphization collection"), dump_mono_stats_format: DumpMonoStatsFormat = (DumpMonoStatsFormat::Markdown, parse_dump_mono_stats, [UNTRACKED], "the format to use for -Z dump-mono-stats (`markdown` (default) or `json`)"), - dump_solver_proof_tree: bool = (false, parse_bool, [UNTRACKED], - "dump a proof tree for every goal evaluated by the new trait solver"), + dump_solver_proof_tree: SolverProofTreeCondition = (SolverProofTreeCondition::Never, parse_solver_proof_tree_condition, [UNTRACKED], + "dump a proof tree for every goal evaluated by the new trait solver. The default is `always`"), + dump_solver_proof_tree_uses_cache: Option<bool> = (None, parse_opt_bool, [UNTRACKED], + "determines whether proof tree generation uses the global cache"), dwarf_version: Option<u32> = (None, parse_opt_number, [TRACKED], "version of DWARF debug information to emit (default: 2 or 4, depending on platform)"), dylib_lto: bool = (false, parse_bool, [UNTRACKED], |
