Skip to content

Commit

Permalink
Rename stock solver to classic
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Jan 4, 2023
1 parent 1e81f9a commit 8b0f43b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ pub enum PrintRequest {

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum TraitSolver {
/// Stock trait solver in `rustc_trait_selection::traits::select`
Stock,
/// Classic trait solver in `rustc_trait_selection::traits::select`
Classic,
/// Chalk trait solver
Chalk,
/// Experimental trait solver in `rustc_trait_selection::solve`
Expand Down
10 changes: 6 additions & 4 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ mod desc {
pub const parse_unpretty: &str = "`string` or `string=string`";
pub const parse_treat_err_as_bug: &str = "either no value or a number bigger than 0";
pub const parse_trait_solver: &str =
"one of the supported solver modes (`stock`, `chalk`, or `next`)";
"one of the supported solver modes (`classic`, `chalk`, or `next`)";
pub const parse_lto: &str =
"either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted";
pub const parse_linker_plugin_lto: &str =
Expand Down Expand Up @@ -884,9 +884,11 @@ mod parse {

pub(crate) fn parse_trait_solver(slot: &mut TraitSolver, v: Option<&str>) -> bool {
match v {
Some("stock") => *slot = TraitSolver::Stock,
Some("classic") => *slot = TraitSolver::Classic,
Some("chalk") => *slot = TraitSolver::Chalk,
Some("next") => *slot = TraitSolver::Next,
// default trait solver is subject to change..
Some("default") => *slot = TraitSolver::Classic,
_ => return false,
}
true
Expand Down Expand Up @@ -1619,8 +1621,8 @@ options! {
"for every macro invocation, print its name and arguments (default: no)"),
track_diagnostics: bool = (false, parse_bool, [UNTRACKED],
"tracks where in rustc a diagnostic was emitted"),
trait_solver: TraitSolver = (TraitSolver::Stock, parse_trait_solver, [TRACKED],
"specify the trait solver mode used by rustc (default: stock)"),
trait_solver: TraitSolver = (TraitSolver::Classic, parse_trait_solver, [TRACKED],
"specify the trait solver mode used by rustc (default: classic)"),
// Diagnostics are considered side-effects of a query (see `QuerySideEffects`) and are saved
// alongside query results and changes to translation options can affect diagnostics - so
// translation options should be tracked.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_trait_selection/src/traits/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ pub trait TraitEngineExt<'tcx> {
impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx> {
fn new(tcx: TyCtxt<'tcx>) -> Box<Self> {
match tcx.sess.opts.unstable_opts.trait_solver {
TraitSolver::Stock => Box::new(FulfillmentContext::new()),
TraitSolver::Classic => Box::new(FulfillmentContext::new()),
TraitSolver::Chalk => Box::new(ChalkFulfillmentContext::new()),
TraitSolver::Next => Box::new(NextFulfillmentCtxt::new()),
}
}

fn new_in_snapshot(tcx: TyCtxt<'tcx>) -> Box<Self> {
match tcx.sess.opts.unstable_opts.trait_solver {
TraitSolver::Stock => Box::new(FulfillmentContext::new_in_snapshot()),
TraitSolver::Classic => Box::new(FulfillmentContext::new_in_snapshot()),
TraitSolver::Chalk => Box::new(ChalkFulfillmentContext::new_in_snapshot()),
TraitSolver::Next => Box::new(NextFulfillmentCtxt::new()),
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/z-help.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
-Z tls-model=val -- choose the TLS model to use (`rustc --print tls-models` for details)
-Z trace-macros=val -- for every macro invocation, print its name and arguments (default: no)
-Z track-diagnostics=val -- tracks where in rustc a diagnostic was emitted
-Z trait-solver=val -- specify the trait solver mode used by rustc (default: stock)
-Z trait-solver=val -- specify the trait solver mode used by rustc (default: classic)
-Z translate-additional-ftl=val -- additional fluent translation to preferentially use (for testing translation)
-Z translate-directionality-markers=val -- emit directionality isolation markers in translated diagnostics
-Z translate-lang=val -- language identifier for diagnostic output
Expand Down

0 comments on commit 8b0f43b

Please sign in to comment.