From 5fff87e156d49303c0aa2b79cc9bd0d20a07f177 Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 12 Oct 2026 16:07:54 +0200 Subject: [PATCH] stabilize `-Znext-solver=globally` --- compiler/rustc_ast_passes/src/diagnostics.rs | 8 ++++---- compiler/rustc_interface/src/tests.rs | 8 +------- compiler/rustc_session/src/config.rs | 8 +------- src/bootstrap/src/core/build_steps/compile.rs | 3 +-- src/bootstrap/src/core/build_steps/test.rs | 4 ++-- src/tools/clippy/tests/compile-test.rs | 4 ++-- src/tools/compiletest/src/runtest.rs | 4 ++-- src/tools/lint-docs/src/lib.rs | 2 +- .../higher-ranked-auto-trait-1.assumptions_next.stderr | 4 ++-- .../next-solver-gce-incompatible-issue-158428.stderr | 4 ++-- .../const-traits/unsatisfied-const-trait-bound.stderr | 4 ++-- 11 files changed, 20 insertions(+), 33 deletions(-) diff --git a/compiler/rustc_ast_passes/src/diagnostics.rs b/compiler/rustc_ast_passes/src/diagnostics.rs index bb006b32ac73e..3ad2d25c1fde8 100644 --- a/compiler/rustc_ast_passes/src/diagnostics.rs +++ b/compiler/rustc_ast_passes/src/diagnostics.rs @@ -40,9 +40,9 @@ pub(crate) struct ImplFnConst { #[derive(Diagnostic)] #[diag("`feature(generic_const_exprs)` is not supported with the next-generation trait solver")] -#[note("`-Znext-solver=globally` is currently enabled by default for testing")] +#[note("`-Znext-solver=globally` has recently been enabled by default")] #[note("reverted the setting to `-Znext-solver=coherence` for this crate")] -#[note("the currently stable trait solver will be used for this crate")] +#[note("the old trait solver will be used for this crate")] #[note("see issues #160895 for more information")] pub(crate) struct NextSolverDisabledForGenericConstExprs { #[primary_span] @@ -52,9 +52,9 @@ pub(crate) struct NextSolverDisabledForGenericConstExprs { #[derive(Diagnostic)] #[diag("`-Zhigher-ranked-assumptions` is not supported with the next-generation trait solver")] #[note("the feature flag will be superseded by `-Zassumptions-on-binders`")] -#[note("`-Znext-solver=globally` is currently enabled by default for testing")] +#[note("`-Znext-solver=globally` has recently been enabled by default")] #[note("reverted the setting to `-Znext-solver=coherence` for this crate")] -#[note("the currently stable trait solver will be used for this crate")] +#[note("the old trait solver will be used for this crate")] #[note("see issues #160895 for more information")] pub(crate) struct NextSolverDisabledForHigherRankedAssumptions; diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index 34ac92faef88c..e73e44c4e8452 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -855,13 +855,7 @@ fn test_unstable_options_tracking_hash() { tracked!(mir_opt_level, Some(4)); tracked!(mir_preserve_ub, true); tracked!(move_size_limit, Some(4096)); - - // tidy-alphabetical-end - // FIXME(#160895): We don't test this when the next-solver is enabled by default. - if option_env!("CFG_DEFAULT_NEXT_SOLVER_GLOBALLY").is_none() { - tracked!(next_solver, NextSolverConfig::Globally); - } - // tidy-alphabetical-start + tracked!(next_solver, NextSolverConfig::Coherence); tracked!(no_generate_arange_section, true); tracked!(no_link, true); tracked!(no_profiler_runtime, true); diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 7e274c66f6f75..222b508282de9 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -1046,15 +1046,9 @@ pub enum NextSolverConfig { Globally, } -// FIXME(#160895): Using -Znext-solver as default on nightly -// See https://github.com/rust-lang/compiler-team/issues/1014 impl Default for NextSolverConfig { fn default() -> Self { - if option_env!("CFG_DEFAULT_NEXT_SOLVER_GLOBALLY").is_some() { - Self::Globally - } else { - Self::Coherence - } + Self::Globally } } diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 3aded58123525..3e7b0551e0e0a 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1371,9 +1371,8 @@ fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec let nightly = builder.config.channel == "nightly" || builder.config.channel == "dev"; if nightly { - // We want to enable Polonius Alpha and Next Trait Solver by default on nighty + // We want to enable Polonius Alpha by default on nighty cargo.env("CFG_DEFAULT_POLONIUS_NEXT", "1"); - cargo.env("CFG_DEFAULT_NEXT_SOLVER_GLOBALLY", "1"); } // These conditionals represent a tension between three forces: diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index c532b670dbef1..c6247cdceeec8 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -3390,7 +3390,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> builder.do_if_verbose(|| println!("doc tests for: {}", markdown.display())); let mut cmd = builder.rustdoc_cmd(compiler); builder.add_rust_test_threads(&mut cmd); - // FIXME(#160895): While the new solver is enabled by default on nightly, + // FIXME(#160895): While the new solver is already enabled by default, // we don't want to use it in our tests for now. cmd.arg("-Znext-solver=coherence"); // allow for unstable options such as new editions @@ -3479,7 +3479,7 @@ fn run_cargo_test<'a>( _ => compiler.stage + 1, }; - // FIXME(#160895): While the new solver is enabled by default on nightly, + // FIXME(#160895): While the new solver is already enabled by default, // we don't want to use it in our tests for now. cargo.rustdocflag("-Znext-solver=coherence"); diff --git a/src/tools/clippy/tests/compile-test.rs b/src/tools/clippy/tests/compile-test.rs index 2a5c3f7e3895d..b0d928440727a 100644 --- a/src/tools/clippy/tests/compile-test.rs +++ b/src/tools/clippy/tests/compile-test.rs @@ -233,7 +233,7 @@ impl TestContext { "-Ainternal_features", "-Zui-testing", "-Zdeduplicate-diagnostics=no", - // FIXME(#160895): While the new solver is enabled by default on nightly, + // FIXME(#160895): While the new solver is already enabled by default, // we don't want to use it in our tests for now. "-Znext-solver=coherence", "-Dwarnings", @@ -343,7 +343,7 @@ fn run_ui_cargo(cx: &TestContext) { config.program.out_dir_flag = CommandBuilder::cargo().out_dir_flag; config.program.args = vec!["clippy".into(), "--color".into(), "never".into(), "--quiet".into()]; config.program.envs.extend([ - // FIXME(#160895): While the new solver is enabled by default on nightly, + // FIXME(#160895): While the new solver is already enabled by default, // we don't want to use it in our tests for now. ("RUSTFLAGS".into(), Some("-Dwarnings -Znext-solver=coherence".into())), ("CARGO_INCREMENTAL".into(), Some("0".into())), diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 263c8d5aded54..22228e0f7c1ef 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1040,7 +1040,7 @@ impl<'test> TestCx<'test> { .arg(file_to_doc) .arg("-A") .arg("internal_features") - // FIXME(#160895): While the new solver is enabled by default on nightly, + // FIXME(#160895): While the new solver is already enabled by default, // we don't want to use it in our tests for now. .arg("-Znext-solver=coherence") .args(&self.props.compile_flags) @@ -1932,7 +1932,7 @@ impl<'test> TestCx<'test> { }, } - // FIXME(#160895): While the new solver is enabled by default on nightly, + // FIXME(#160895): While the new solver is already enabled by default, // we don't want to use it in our tests for now. compiler.args(["-Znext-solver=coherence"]); diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs index 3f3deee1ad424..13d6d55a2df1e 100644 --- a/src/tools/lint-docs/src/lib.rs +++ b/src/tools/lint-docs/src/lib.rs @@ -473,7 +473,7 @@ impl<'a> LintExtractor<'a> { cmd.arg(format!("--edition={edition}")); // Just in case this is an unstable edition. cmd.arg("-Zunstable-options"); - // FIXME(#160895): While the new solver is enabled by default on nightly, + // FIXME(#160895): While the new solver is already enabled by default, // we don't want to use it in our tests for now. cmd.arg("-Znext-solver=coherence"); cmd.arg("--error-format=json"); diff --git a/tests/ui/async-await/witness-auto-trait/higher-ranked-auto-trait-1.assumptions_next.stderr b/tests/ui/async-await/witness-auto-trait/higher-ranked-auto-trait-1.assumptions_next.stderr index c2078fdefafa6..f1fbdb605c7aa 100644 --- a/tests/ui/async-await/witness-auto-trait/higher-ranked-auto-trait-1.assumptions_next.stderr +++ b/tests/ui/async-await/witness-auto-trait/higher-ranked-auto-trait-1.assumptions_next.stderr @@ -1,9 +1,9 @@ warning: `-Zhigher-ranked-assumptions` is not supported with the next-generation trait solver | = note: the feature flag will be superseded by `-Zassumptions-on-binders` - = note: `-Znext-solver=globally` is currently enabled by default for testing + = note: `-Znext-solver=globally` has recently been enabled by default = note: reverted the setting to `-Znext-solver=coherence` for this crate - = note: the currently stable trait solver will be used for this crate + = note: the old trait solver will be used for this crate = note: see issues #160895 for more information warning: 1 warning emitted diff --git a/tests/ui/const-generics/generic_const_exprs/next-solver-gce-incompatible-issue-158428.stderr b/tests/ui/const-generics/generic_const_exprs/next-solver-gce-incompatible-issue-158428.stderr index 77432c78263af..63b82821e3461 100644 --- a/tests/ui/const-generics/generic_const_exprs/next-solver-gce-incompatible-issue-158428.stderr +++ b/tests/ui/const-generics/generic_const_exprs/next-solver-gce-incompatible-issue-158428.stderr @@ -4,9 +4,9 @@ warning: `feature(generic_const_exprs)` is not supported with the next-generatio LL | #![feature(generic_const_exprs)] | ^^^^^^^^^^^^^^^^^^^ | - = note: `-Znext-solver=globally` is currently enabled by default for testing + = note: `-Znext-solver=globally` has recently been enabled by default = note: reverted the setting to `-Znext-solver=coherence` for this crate - = note: the currently stable trait solver will be used for this crate + = note: the old trait solver will be used for this crate = note: see issues #160895 for more information warning: union `AsBytes` is never used diff --git a/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr b/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr index 26832153ea90a..3503395c143b9 100644 --- a/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr +++ b/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr @@ -4,9 +4,9 @@ warning: `feature(generic_const_exprs)` is not supported with the next-generatio LL | #![feature(const_trait_impl, generic_const_exprs)] | ^^^^^^^^^^^^^^^^^^^ | - = note: `-Znext-solver=globally` is currently enabled by default for testing + = note: `-Znext-solver=globally` has recently been enabled by default = note: reverted the setting to `-Znext-solver=coherence` for this crate - = note: the currently stable trait solver will be used for this crate + = note: the old trait solver will be used for this crate = note: see issues #160895 for more information error[E0277]: the trait bound `T: const Trait` is not satisfied