Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2ecba0f

Browse files
committed
Auto merge of rust-lang#118937 - lcnr:rename-solver-flag, r=compiler-errors
`-Ztrait-solver=next` to `-Znext-solver` renames the feature flag to enable the new trait solver. still want some feedback before merging: https://rust-lang.zulipchat.com/#narrow/stream/364551-t-types.2Ftrait-system-refactor/topic/renaming.20the.20feature.20flag.20to.20.60-Znew-solver.60. The idea is to make it easier to add another option, e.g. to enable the solver in wfcheck or to optionally change its behavior to our new coinduction approach. r? `@compiler-errors`
2 parents 529047c + fa03289 commit 2ecba0f

File tree

274 files changed

+345
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+345
-333
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ fn check_opaque_type_well_formed<'tcx>(
315315
parent_def_id = tcx.local_parent(parent_def_id);
316316
}
317317

318-
// FIXME(-Ztrait-solver=next): We probably should use `DefiningAnchor::Error`
318+
// FIXME(-Znext-solver): We probably should use `DefiningAnchor::Error`
319319
// and prepopulate this `InferCtxt` with known opaque values, rather than
320320
// using the `Bind` anchor here. For now it's fine.
321321
let infcx = tcx

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,16 +1003,16 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
10031003
reported_errors: Default::default(),
10041004
};
10051005

1006-
// FIXME(-Ztrait-solver=next): A bit dubious that we're only registering
1006+
// FIXME(-Znext-solver): A bit dubious that we're only registering
10071007
// predefined opaques in the typeck root.
10081008
if infcx.next_trait_solver() && !infcx.tcx.is_typeck_child(body.source.def_id()) {
1009-
checker.register_predefined_opaques_in_new_solver();
1009+
checker.register_predefined_opaques_for_next_solver();
10101010
}
10111011

10121012
checker
10131013
}
10141014

1015-
pub(super) fn register_predefined_opaques_in_new_solver(&mut self) {
1015+
pub(super) fn register_predefined_opaques_for_next_solver(&mut self) {
10161016
// OK to use the identity arguments for each opaque type key, since
10171017
// we remap opaques from HIR typeck back to their definition params.
10181018
let opaques: Vec<_> = self

compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copied from https://github.com/rust-lang/rust/blob/46455dc65069387f2dc46612f13fd45452ab301a/tests/ui/coroutine/gen_block_iterate.rs
22
// revisions: next old
33
//compile-flags: --edition 2024 -Zunstable-options
4-
//[next] compile-flags: -Ztrait-solver=next
4+
//[next] compile-flags: -Znext-solver
55
// run-pass
66
#![feature(gen_blocks)]
77

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ fn compare_method_predicate_entailment<'tcx>(
320320
if check_implied_wf == CheckImpliedWfMode::Check && !(impl_sig, trait_sig).references_error() {
321321
// Select obligations to make progress on inference before processing
322322
// the wf obligation below.
323-
// FIXME(-Ztrait-solver=next): Not needed when the hack below is removed.
323+
// FIXME(-Znext-solver): Not needed when the hack below is removed.
324324
let errors = ocx.select_where_possible();
325325
if !errors.is_empty() {
326326
let reported = infcx.err_ctxt().report_fulfillment_errors(errors);
@@ -333,7 +333,7 @@ fn compare_method_predicate_entailment<'tcx>(
333333
// trigger the lint. Instead, let's only consider type outlives and
334334
// region outlives obligations.
335335
//
336-
// FIXME(-Ztrait-solver=next): Try removing this hack again once
336+
// FIXME(-Znext-solver): Try removing this hack again once
337337
// the new solver is stable.
338338
let mut wf_args: smallvec::SmallVec<[_; 4]> =
339339
unnormalized_impl_sig.inputs_and_output.iter().map(|ty| ty.into()).collect();

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10191019
/// Returns false if the coercion creates any obligations that result in
10201020
/// errors.
10211021
pub fn can_coerce(&self, expr_ty: Ty<'tcx>, target: Ty<'tcx>) -> bool {
1022-
// FIXME(-Ztrait-solver=next): We need to structurally resolve both types here.
1022+
// FIXME(-Znext-solver): We need to structurally resolve both types here.
10231023
let source = self.resolve_vars_with_obligations(expr_ty);
10241024
debug!("coercion::can_with_predicates({:?} -> {:?})", source, target);
10251025

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
8383
/// version (resolve_vars_if_possible), this version will
8484
/// also select obligations if it seems useful, in an effort
8585
/// to get more type information.
86-
// FIXME(-Ztrait-solver=next): A lot of the calls to this method should
86+
// FIXME(-Znext-solver): A lot of the calls to this method should
8787
// probably be `try_structurally_resolve_type` or `structurally_resolve_type` instead.
8888
#[instrument(skip(self), level = "debug", ret)]
8989
pub(in super::super) fn resolve_vars_with_obligations(&self, mut ty: Ty<'tcx>) -> Ty<'tcx> {

compiler/rustc_infer/src/infer/canonical/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'tcx> InferCtxt<'tcx> {
101101
/// variable, then you'll get a new inference variable; if it is a
102102
/// universally quantified variable, you get a placeholder.
103103
///
104-
/// FIXME(-Ztrait-solver=next): This is public because it's used by the
104+
/// FIXME(-Znext-solver): This is public because it's used by the
105105
/// new trait solver which has a different canonicalization routine.
106106
/// We should somehow deduplicate all of this.
107107
pub fn instantiate_canonical_var(

compiler/rustc_infer/src/infer/canonical/substitute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_middle::ty::fold::{FnMutDelegate, TypeFoldable};
1111
use rustc_middle::ty::GenericArgKind;
1212
use rustc_middle::ty::{self, TyCtxt};
1313

14-
/// FIXME(-Ztrait-solver=next): This or public because it is shared with the
14+
/// FIXME(-Znext-solver): This or public because it is shared with the
1515
/// new trait solver implementation. We should deduplicate canonicalization.
1616
pub trait CanonicalExt<'tcx, V> {
1717
/// Instantiate the wrapped value, replacing each canonical value

compiler/rustc_infer/src/traits/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub enum FulfillmentErrorCode<'tcx> {
135135
CodeSubtypeError(ExpectedFound<Ty<'tcx>>, TypeError<'tcx>), // always comes from a SubtypePredicate
136136
CodeConstEquateError(ExpectedFound<Const<'tcx>>, TypeError<'tcx>),
137137
CodeAmbiguity {
138-
/// Overflow reported from the new solver `-Ztrait-solver=next`, which will
138+
/// Overflow reported from the new solver `-Znext-solver`, which will
139139
/// be reported as an regular error as opposed to a fatal error.
140140
overflow: bool,
141141
},

compiler/rustc_interface/src/tests.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ use rustc_session::config::{
66
build_configuration, build_session_options, rustc_optgroups, BranchProtection, CFGuard, Cfg,
77
DebugInfo, DumpMonoStatsFormat, ErrorOutputType, ExternEntry, ExternLocation, Externs,
88
FunctionReturn, InliningThreshold, Input, InstrumentCoverage, InstrumentXRay,
9-
LinkSelfContained, LinkerPluginLto, LocationDetail, LtoCli, MirSpanview, OomStrategy, Options,
10-
OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, Passes, Polonius,
11-
ProcMacroExecutionStrategy, Strip, SwitchWithOptPath, SymbolManglingVersion, TraitSolver,
12-
WasiExecModel,
9+
LinkSelfContained, LinkerPluginLto, LocationDetail, LtoCli, MirSpanview, NextSolverConfig,
10+
OomStrategy, Options, OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, Passes, Polonius,
11+
ProcMacroExecutionStrategy, Strip, SwitchWithOptPath, SymbolManglingVersion, WasiExecModel,
1312
};
1413
use rustc_session::lint::Level;
1514
use rustc_session::search_paths::SearchPath;
@@ -781,6 +780,10 @@ fn test_unstable_options_tracking_hash() {
781780
tracked!(mir_opt_level, Some(4));
782781
tracked!(move_size_limit, Some(4096));
783782
tracked!(mutable_noalias, false);
783+
tracked!(
784+
next_solver,
785+
Some(NextSolverConfig { coherence: true, globally: false, dump_tree: Default::default() })
786+
);
784787
tracked!(no_generate_arange_section, true);
785788
tracked!(no_jump_tables, true);
786789
tracked!(no_link, true);
@@ -822,7 +825,6 @@ fn test_unstable_options_tracking_hash() {
822825
tracked!(thir_unsafeck, true);
823826
tracked!(tiny_const_eval_limit, true);
824827
tracked!(tls_model, Some(TlsModel::GeneralDynamic));
825-
tracked!(trait_solver, TraitSolver::NextCoherence);
826828
tracked!(translate_remapped_path_to_local_path, false);
827829
tracked!(trap_unreachable, Some(false));
828830
tracked!(treat_err_as_bug, NonZeroUsize::new(1));

0 commit comments

Comments
 (0)