diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-11 17:57:04 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-09-11 17:57:04 -0400 |
| commit | e866f8a97d1f08e8a187323a1a5838f88fe33d81 (patch) | |
| tree | b5b5675acfc77c3600499249f0a95b53e7cbfac0 /compiler/rustc_session/src/options.rs | |
| parent | 5bce6d48ff09dcb2613278ec93013795718478ef (diff) | |
| download | rust-e866f8a97d1f08e8a187323a1a5838f88fe33d81.tar.gz rust-e866f8a97d1f08e8a187323a1a5838f88fe33d81.zip | |
Revert 'Stabilize -Znext-solver=coherence'
Diffstat (limited to 'compiler/rustc_session/src/options.rs')
| -rw-r--r-- | compiler/rustc_session/src/options.rs | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index a57dc80b316..45339c23ea3 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -403,7 +403,7 @@ mod desc { pub(crate) const parse_unpretty: &str = "`string` or `string=string`"; pub(crate) const parse_treat_err_as_bug: &str = "either no value or a non-negative number"; pub(crate) const parse_next_solver_config: &str = - "either `globally` (when used without an argument), `coherence` (default) or `no`"; + "a comma separated list of solver configurations: `globally` (default), and `coherence`"; pub(crate) const parse_lto: &str = "either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted"; pub(crate) const parse_linker_plugin_lto: &str = @@ -1105,16 +1105,27 @@ mod parse { } } - pub(crate) fn parse_next_solver_config(slot: &mut NextSolverConfig, v: Option<&str>) -> bool { + pub(crate) fn parse_next_solver_config( + slot: &mut Option<NextSolverConfig>, + v: Option<&str>, + ) -> bool { if let Some(config) = v { - *slot = match config { - "no" => NextSolverConfig { coherence: false, globally: false }, - "coherence" => NextSolverConfig { coherence: true, globally: false }, - "globally" => NextSolverConfig { coherence: true, globally: true }, - _ => return false, - }; + let mut coherence = false; + let mut globally = true; + for c in config.split(',') { + match c { + "globally" => globally = true, + "coherence" => { + globally = false; + coherence = true; + } + _ => return false, + } + } + + *slot = Some(NextSolverConfig { coherence: coherence || globally, globally }); } else { - *slot = NextSolverConfig { coherence: true, globally: true }; + *slot = Some(NextSolverConfig { coherence: true, globally: true }); } true @@ -1867,7 +1878,7 @@ options! { "the size at which the `large_assignments` lint starts to be emitted"), mutable_noalias: bool = (true, parse_bool, [TRACKED], "emit noalias metadata for mutable references (default: yes)"), - next_solver: NextSolverConfig = (NextSolverConfig::default(), parse_next_solver_config, [TRACKED], + next_solver: Option<NextSolverConfig> = (None, parse_next_solver_config, [TRACKED], "enable and configure the next generation trait solver used by rustc"), nll_facts: bool = (false, parse_bool, [UNTRACKED], "dump facts from NLL analysis into side files (default: no)"), |
