Rollup merge of #161491 - sjwang05:no-old-coherence, r=khyperia

Rip out old solver coherence

cc [#t-types/call-for-participation > rip out old solver coherence support](https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/rip.20out.20old.20solver.20coherence.20support/with/613938355)

Probably best reviewed commit-by-commit with ignore-whitespace.

https://github.com/rust-lang/rust/pull/160668 replaced the last remaining place where old solver was still used by default in coherence with new solver. This PR removes code that was only used during coherence by the old solver, so now new-solver coherence is the *only* way to do coherence. So we don't confuse users, passing `-Znext-solver=coherence` and `=no` now do the exact same thing.

We also remove tracking intercrate ambiguity causes, since afaict the new solver uses a completely different path.

Everything else is either removing code that is now unreachable, or removing a condition that is now always true.

r? lcnr
This commit is contained in:
Jonathan Brouwer
2026-10-04 21:28:21 +02:00
committed by GitHub
48 changed files with 153 additions and 409 deletions

View File

@@ -5,6 +5,7 @@ use rustc_attr_parsing::AttributeParser;
use rustc_errors::msg;
use rustc_feature::{DependentFeature, Features};
use rustc_session::Session;
use rustc_session::config::NextSolverConfig;
use rustc_session::diagnostics::{feature_err, feature_warn};
use rustc_span::{Span, Spanned, sym};
@@ -698,7 +699,7 @@ fn check_dependent_features(sess: &Session, features: &Features) {
}
fn warn_next_solver_and_gce(sess: &Session, features: &Features) {
if !sess.opts.unstable_opts.next_solver.globally {
if sess.opts.unstable_opts.next_solver != NextSolverConfig::Globally {
return;
}
@@ -716,7 +717,7 @@ fn warn_next_solver_and_gce(sess: &Session, features: &Features) {
}
fn check_features_requiring_new_solver(sess: &Session, features: &Features) {
if sess.opts.unstable_opts.next_solver.globally {
if sess.opts.unstable_opts.next_solver == NextSolverConfig::Globally {
return;
}

View File

@@ -321,7 +321,7 @@ fn orphan_check<'tcx>(
// (1) Instantiate all generic params with fresh inference vars.
let infcx = tcx
.infer_ctxt()
.with_next_trait_solver(tcx.next_trait_solver_in_coherence())
.with_next_trait_solver(true)
.enable_next_solver_overflow_fcw(false)
.build(TypingMode::Coherence);
let cause = traits::ObligationCause::dummy();

View File

@@ -859,7 +859,7 @@ fn test_unstable_options_tracking_hash() {
// 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 { coherence: true, globally: true });
tracked!(next_solver, NextSolverConfig::Globally);
}
// tidy-alphabetical-start
tracked!(no_generate_arange_section, true);
@@ -948,7 +948,7 @@ fn test_edition_parsing() {
#[test]
fn test_assumptions_on_binders_enables_next_solver_globally() {
let globally = NextSolverConfig { coherence: true, globally: true };
let globally = NextSolverConfig::Globally;
let mut early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default());
// `-Zassumptions-on-binders` alone enables the next solver globally.
@@ -957,18 +957,6 @@ fn test_assumptions_on_binders_enables_next_solver_globally() {
assert!(opts.unstable_opts.assumptions_on_binders);
assert_eq!(opts.unstable_opts.next_solver, globally);
// Flag order must not matter when both `-Zassumptions-on-binders` and `-Znext-solver`
// are present.
for args in [
["-Zassumptions-on-binders".to_string(), "-Znext-solver=coherence".to_string()],
["-Znext-solver=coherence".to_string(), "-Zassumptions-on-binders".to_string()],
] {
let matches = optgroups().parse(&args).unwrap();
let opts = build_session_options(&mut early_dcx, &matches, false);
assert!(opts.unstable_opts.assumptions_on_binders);
assert_eq!(opts.unstable_opts.next_solver, globally);
}
// `-Zassumptions-on-binders` overrides `-Znext-solver=no` regardless of order, since
// the assumptions implementation requires the next solver. This also emits an early
// warning (covered by the UI test `next-solver-no-overridden`).

View File

@@ -40,6 +40,7 @@ use rustc_index::IndexVec;
use rustc_lint_defs::Lint;
use rustc_lint_defs::builtin::UNUSED_FEATURES;
use rustc_macros::Diagnostic;
use rustc_session::config::NextSolverConfig;
use rustc_session::{IncrCompSession, Session};
use rustc_span::def_id::{CRATE_DEF_ID, DefPathHash, StableCrateId};
use rustc_span::{DUMMY_SP, Ident, Span, Symbol, bug, kw, sym};
@@ -2816,11 +2817,8 @@ impl<'tcx> TyCtxt<'tcx> {
}
pub fn next_trait_solver_globally(self) -> bool {
self.sess.opts.unstable_opts.next_solver.globally && !self.features().generic_const_exprs()
}
pub fn next_trait_solver_in_coherence(self) -> bool {
self.sess.opts.unstable_opts.next_solver.coherence
self.sess.opts.unstable_opts.next_solver == NextSolverConfig::Globally
&& !self.features().generic_const_exprs()
}
pub fn disable_trait_solver_fast_paths(self) -> bool {

View File

@@ -1039,13 +1039,11 @@ impl ExternEntry {
}
}
/// Where the new trait solver should be enabled only in coherence or everywhere.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NextSolverConfig {
/// Whether the new trait solver should be enabled in coherence.
pub coherence: bool = true,
/// Whether the new trait solver should be enabled everywhere.
/// This is only `true` if `coherence` is also enabled.
pub globally: bool = false,
pub enum NextSolverConfig {
Coherence,
Globally,
}
// FIXME(#160895): Using -Znext-solver as default on nightly
@@ -1053,9 +1051,9 @@ pub struct NextSolverConfig {
impl Default for NextSolverConfig {
fn default() -> Self {
if option_env!("CFG_DEFAULT_NEXT_SOLVER_GLOBALLY").is_some() {
Self { coherence: true, globally: true }
Self::Globally
} else {
Self { coherence: true, globally: false }
Self::Coherence
}
}
}
@@ -2734,17 +2732,22 @@ pub fn build_session_options(
// `-Zassumptions-on-binders` requires the next trait solver globally. Normalize after
// parsing so the effective config is independent of flag order and so consumers that
// read `next_solver.globally` directly (e.g. feature-gate checks) see the right value.
// read `next_solver` directly (e.g. feature-gate checks) see the right value.
if unstable_opts.assumptions_on_binders {
// `NextSolverConfig::default()` has `coherence: true`; the only way `coherence` is
// false here is an explicit `-Znext-solver=no`.
if !unstable_opts.next_solver.coherence {
// Only warn when the last `-Znext-solver` given has a value that doesn't enable
// the solver globally, so a later `-Znext-solver=globally` overrides an earlier one.
let no_next_solver = matches
.opt_strs("Z")
.iter()
.rfind(|arg| arg.starts_with("next-solver"))
.is_some_and(|arg| *arg == "next-solver=no" || *arg == "next-solver=coherence");
if no_next_solver {
early_dcx.early_warn(
"-Zassumptions-on-binders unconditionally enables the next trait solver; \
`-Znext-solver=no` is ignored",
);
}
unstable_opts.next_solver = NextSolverConfig { coherence: true, globally: true };
unstable_opts.next_solver = NextSolverConfig::Globally;
}
if unstable_opts.staticlib_hide_internal_symbols && !crate_types.contains(&CrateType::StaticLib)

View File

@@ -877,7 +877,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`";
"either `globally` (when used without an argument), or `coherence` (default)";
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 =
@@ -1795,13 +1795,12 @@ pub mod parse {
pub(crate) fn parse_next_solver_config(slot: &mut 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 },
"no" | "coherence" => NextSolverConfig::Coherence,
"globally" => NextSolverConfig::Globally,
_ => return false,
};
} else {
*slot = NextSolverConfig { coherence: true, globally: true };
*slot = NextSolverConfig::Globally;
}
true

View File

@@ -11,7 +11,6 @@
//! This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(unwrap_infallible))]
#![feature(associated_type_defaults)]
#![feature(default_field_values)]
#![feature(deref_patterns)]

View File

@@ -33,8 +33,7 @@ use crate::solve::{SolverDelegate, deeply_normalize_for_diagnostics, inspect};
use crate::traits::query::evaluate_obligation::InferCtxtExt;
use crate::traits::select::IntercrateAmbiguityCause;
use crate::traits::{
FulfillmentErrorCode, NormalizeExt, Obligation, ObligationCause, PredicateObligation,
SelectionContext, SkipLeakCheck, util,
FulfillmentErrorCode, Obligation, ObligationCause, PredicateObligation, SkipLeakCheck, util,
};
/// The "header" of an impl is everything outside the body: a Self type, a trait
@@ -79,21 +78,6 @@ pub(crate) fn suggest_increasing_recursion_limit<'tcx>(
suggest_new_overflow_limit(tcx, err);
}
#[derive(Debug, Clone, Copy)]
enum TrackAmbiguityCauses {
Yes,
No,
}
impl TrackAmbiguityCauses {
fn is_yes(self) -> bool {
match self {
TrackAmbiguityCauses::Yes => true,
TrackAmbiguityCauses::No => false,
}
}
}
/// If there are types that satisfy both impls, returns `Some`
/// with a suitably-freshened `ImplHeader` with those types
/// instantiated. Otherwise, returns `None`.
@@ -157,42 +141,7 @@ fn overlapping_impls(
overlap_mode: OverlapMode,
is_of_trait: bool,
) -> Option<OverlapResult<'_>> {
if tcx.next_trait_solver_in_coherence() {
overlap(
tcx,
TrackAmbiguityCauses::Yes,
skip_leak_check,
impl1_def_id,
impl2_def_id,
overlap_mode,
is_of_trait,
)
} else {
let _overlap_with_bad_diagnostics = overlap(
tcx,
TrackAmbiguityCauses::No,
skip_leak_check,
impl1_def_id,
impl2_def_id,
overlap_mode,
is_of_trait,
)?;
// In the case where we detect an error, run the check again, but
// this time tracking intercrate ambiguity causes for better
// diagnostics. (These take time and can lead to false errors.)
let overlap = overlap(
tcx,
TrackAmbiguityCauses::Yes,
skip_leak_check,
impl1_def_id,
impl2_def_id,
overlap_mode,
is_of_trait,
)
.unwrap();
Some(overlap)
}
overlap(tcx, skip_leak_check, impl1_def_id, impl2_def_id, overlap_mode, is_of_trait)
}
fn fresh_impl_header<'tcx>(
@@ -217,27 +166,11 @@ fn fresh_impl_header<'tcx>(
}
}
fn fresh_impl_header_normalized<'tcx>(
infcx: &InferCtxt<'tcx>,
param_env: ty::ParamEnv<'tcx>,
impl_def_id: DefId,
is_of_trait: bool,
) -> ImplHeader<'tcx> {
let header = fresh_impl_header(infcx, impl_def_id, is_of_trait);
let InferOk { value: mut header, obligations } =
infcx.at(&ObligationCause::dummy(), param_env).normalize(Unnormalized::new_wip(header));
header.predicates.extend(obligations.into_iter().map(|o| o.predicate));
header
}
/// Can both impl `a` and impl `b` be satisfied by a common type (including
/// where-clauses)? If so, returns an `ImplHeader` that unifies the two impls.
#[instrument(level = "debug", skip(tcx))]
fn overlap<'tcx>(
tcx: TyCtxt<'tcx>,
track_ambiguity_causes: TrackAmbiguityCauses,
skip_leak_check: SkipLeakCheck,
impl1_def_id: DefId,
impl2_def_id: DefId,
@@ -260,13 +193,9 @@ fn overlap<'tcx>(
let infcx = tcx
.infer_ctxt()
.skip_leak_check(skip_leak_check.is_yes())
.with_next_trait_solver(tcx.next_trait_solver_in_coherence())
.with_next_trait_solver(true)
.enable_next_solver_overflow_fcw(false)
.build(TypingMode::Coherence);
let selcx = &mut SelectionContext::new(&infcx);
if track_ambiguity_causes.is_yes() {
selcx.enable_tracking_intercrate_ambiguity_causes();
}
// For the purposes of this check, we don't bring any placeholder
// types into scope; instead, we replace the generic types with
@@ -274,21 +203,12 @@ fn overlap<'tcx>(
// empty environment.
let param_env = ty::ParamEnv::empty();
let impl1_header = if tcx.next_trait_solver_in_coherence() {
fresh_impl_header(selcx.infcx, impl1_def_id, is_of_trait)
} else {
fresh_impl_header_normalized(selcx.infcx, param_env, impl1_def_id, is_of_trait)
};
let impl2_header = if tcx.next_trait_solver_in_coherence() {
fresh_impl_header(selcx.infcx, impl2_def_id, is_of_trait)
} else {
fresh_impl_header_normalized(selcx.infcx, param_env, impl2_def_id, is_of_trait)
};
let impl1_header = fresh_impl_header(&infcx, impl1_def_id, is_of_trait);
let impl2_header = fresh_impl_header(&infcx, impl2_def_id, is_of_trait);
// Equate the headers to find their intersection (the general type, with infer vars,
// that may apply both impls).
let mut obligations =
equate_impl_headers(selcx.infcx, param_env, &impl1_header, &impl2_header)?;
let mut obligations = equate_impl_headers(&infcx, param_env, &impl1_header, &impl2_header)?;
debug!("overlap: unification check succeeded");
obligations.extend(
@@ -299,7 +219,7 @@ fn overlap<'tcx>(
let mut overflowing_predicates = Vec::new();
if overlap_mode.use_implicit_negative() {
match impl_intersection_has_impossible_obligation(selcx, &obligations) {
match impl_intersection_has_impossible_obligation(&infcx, &obligations) {
IntersectionHasImpossibleObligations::Yes => return None,
IntersectionHasImpossibleObligations::No { overflowing_predicates: p } => {
overflowing_predicates = p
@@ -316,10 +236,8 @@ fn overlap<'tcx>(
let intercrate_ambiguity_causes = if !overlap_mode.use_implicit_negative() {
Default::default()
} else if infcx.next_trait_solver() {
compute_intercrate_ambiguity_causes(&infcx, &obligations)
} else {
selcx.take_intercrate_ambiguity_causes()
compute_intercrate_ambiguity_causes(&infcx, &obligations)
};
debug!("overlap: intercrate_ambiguity_causes={:#?}", intercrate_ambiguity_causes);
@@ -335,9 +253,7 @@ fn overlap<'tcx>(
let mut impl_header = infcx.deeply_resolve_ignoring_regions(impl1_header);
// Deeply normalize the impl header for diagnostics, ignoring any errors if this fails.
if infcx.next_trait_solver() {
impl_header = deeply_normalize_for_diagnostics(&infcx, param_env, impl_header);
}
impl_header = deeply_normalize_for_diagnostics(&infcx, param_env, impl_header);
Some(OverlapResult {
impl_header,
@@ -375,7 +291,7 @@ fn equate_impl_headers<'tcx>(
enum IntersectionHasImpossibleObligations<'tcx> {
Yes,
No {
/// With `-Znext-solver=coherence`, some obligations may
/// With the next solver, some obligations may
/// fail if only the user increased the recursion limit.
///
/// We return those obligations here and mention them in the
@@ -402,78 +318,53 @@ enum IntersectionHasImpossibleObligations<'tcx> {
/// of the two impls above to be empty.
///
/// Importantly, this works even if there isn't a `impl !Error for MyLocalType`.
#[instrument(level = "debug", skip(selcx), ret)]
fn impl_intersection_has_impossible_obligation<'a, 'cx, 'tcx>(
selcx: &mut SelectionContext<'cx, 'tcx>,
#[instrument(level = "debug", skip(infcx), ret)]
fn impl_intersection_has_impossible_obligation<'a, 'tcx>(
infcx: &InferCtxt<'tcx>,
obligations: &'a [PredicateObligation<'tcx>],
) -> IntersectionHasImpossibleObligations<'tcx> {
let infcx = selcx.infcx;
// A fast path optimization, try evaluating all goals with
// a very low recursion depth and bail if any of them don't
// hold.
if !obligations.iter().all(|o| {
<&SolverDelegate<'tcx>>::from(infcx)
.root_goal_may_hold_with_depth(8, Goal::new(infcx.tcx, o.param_env, o.predicate))
}) {
return IntersectionHasImpossibleObligations::Yes;
}
if infcx.next_trait_solver() {
// A fast path optimization, try evaluating all goals with
// a very low recursion depth and bail if any of them don't
// hold.
if !obligations.iter().all(|o| {
<&SolverDelegate<'tcx>>::from(infcx)
.root_goal_may_hold_with_depth(8, Goal::new(infcx.tcx, o.param_env, o.predicate))
}) {
return IntersectionHasImpossibleObligations::Yes;
}
let ocx = ObligationCtxt::new(infcx);
ocx.register_obligations(obligations.iter().cloned());
let hard_errors = ocx.try_evaluate_obligations();
if let TraitErrors::HasErrors(hard_errors) = hard_errors {
assert!(
hard_errors.iter().all(|e| e.is_true_error()),
"should not have detected ambiguity during first pass"
);
return IntersectionHasImpossibleObligations::Yes;
}
let ocx = ObligationCtxt::new(infcx);
ocx.register_obligations(obligations.iter().cloned());
let hard_errors = ocx.try_evaluate_obligations();
if let TraitErrors::HasErrors(hard_errors) = hard_errors {
assert!(
hard_errors.iter().all(|e| e.is_true_error()),
"should not have detected ambiguity during first pass"
);
return IntersectionHasImpossibleObligations::Yes;
}
// Make a new `ObligationCtxt` and re-prove the ambiguities with a richer
// `FulfillmentError`. This is so that we can detect overflowing obligations
// without needing to run the `BestObligation` visitor on true errors.
let ambiguities = ocx.into_pending_obligations();
let ocx = ObligationCtxt::new_with_diagnostics(infcx);
ocx.register_obligations(ambiguities);
let errors_and_ambiguities = ocx.evaluate_obligations_error_on_ambiguity();
// We only care about the obligations that are *definitely* true errors.
// Ambiguities do not prove the disjointness of two impls.
let (errors, ambiguities): (Vec<_>, Vec<_>) =
errors_and_ambiguities.into_iter().partition(|error| error.is_true_error());
assert!(errors.is_empty(), "should not have ambiguities during second pass");
// Make a new `ObligationCtxt` and re-prove the ambiguities with a richer
// `FulfillmentError`. This is so that we can detect overflowing obligations
// without needing to run the `BestObligation` visitor on true errors.
let ambiguities = ocx.into_pending_obligations();
let ocx = ObligationCtxt::new_with_diagnostics(infcx);
ocx.register_obligations(ambiguities);
let errors_and_ambiguities = ocx.evaluate_obligations_error_on_ambiguity();
// We only care about the obligations that are *definitely* true errors.
// Ambiguities do not prove the disjointness of two impls.
let (errors, ambiguities): (Vec<_>, Vec<_>) =
errors_and_ambiguities.into_iter().partition(|error| error.is_true_error());
assert!(errors.is_empty(), "should not have ambiguities during second pass");
IntersectionHasImpossibleObligations::No {
overflowing_predicates: ambiguities
.into_iter()
.filter(|error| {
matches!(error.code, FulfillmentErrorCode::Ambiguity { overflow: Some(true) })
})
.map(|e| infcx.deeply_resolve_ignoring_regions(e.obligation.predicate))
.collect(),
}
} else {
for obligation in obligations {
// We use `evaluate_root_obligation` to correctly track intercrate
// ambiguity clauses.
let evaluation_result = selcx.evaluate_root_obligation(obligation);
match evaluation_result {
Ok(result) => {
if !result.may_apply() {
return IntersectionHasImpossibleObligations::Yes;
}
}
// If overflow occurs, we need to conservatively treat the goal as possibly holding,
// since there can be instantiations of this goal that don't overflow and result in
// success. While this isn't much of a problem in the old solver, since we treat overflow
// fatally, this still can be encountered: <https://github.com/rust-lang/rust/issues/105231>.
Err(_overflow) => {}
}
}
IntersectionHasImpossibleObligations::No { overflowing_predicates: Vec::new() }
IntersectionHasImpossibleObligations::No {
overflowing_predicates: ambiguities
.into_iter()
.filter(|error| {
matches!(error.code, FulfillmentErrorCode::Ambiguity { overflow: Some(true) })
})
.map(|e| infcx.deeply_resolve_ignoring_regions(e.obligation.predicate))
.collect(),
}
}

View File

@@ -176,12 +176,14 @@ where
TypingMode::Typeck { defining_opaque_types_and_generators } => {
defining_opaque_types_and_generators
}
TypingMode::Coherence
| TypingMode::PostTypeckUntilBorrowck { defining_opaque_types: _ }
TypingMode::PostTypeckUntilBorrowck { defining_opaque_types: _ }
| TypingMode::PostBorrowck { defined_opaque_types: _ }
| TypingMode::Reflection
| TypingMode::PostAnalysis
| TypingMode::Codegen => return Default::default(),
TypingMode::Coherence => {
unreachable!("old solver coherence")
}
};
if stalled_coroutines.is_empty() {
@@ -872,8 +874,9 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
trait_obligation: PolyTraitObligation<'tcx>,
stalled_on: &mut Vec<TyOrConstInferVar>,
) -> ProcessResult<PendingPredicateObligation<'tcx>, FulfillmentErrorCode<'tcx>> {
debug_assert!(!self.selcx.typing_mode().is_coherence(), "old solver coherence");
let infcx = self.selcx.infcx;
if obligation.predicate.is_global() && !self.selcx.typing_mode().is_coherence() {
if obligation.predicate.is_global() {
// no type variables present, can use evaluation for better caching.
// FIXME: consider caching errors too.
if infcx.predicate_must_hold_considering_regions(obligation) {
@@ -925,9 +928,11 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
project_obligation: PolyProjectionObligation<'tcx>,
stalled_on: &mut Vec<TyOrConstInferVar>,
) -> ProcessResult<PendingPredicateObligation<'tcx>, FulfillmentErrorCode<'tcx>> {
debug_assert!(!self.selcx.typing_mode().is_coherence(), "old solver coherence");
let tcx = self.selcx.tcx();
let infcx = self.selcx.infcx;
if obligation.predicate.is_global() && !self.selcx.typing_mode().is_coherence() {
if obligation.predicate.is_global() {
// no type variables present, can use evaluation for better caching.
// FIXME: consider caching errors too.
if infcx.predicate_must_hold_considering_regions(obligation) {

View File

@@ -139,11 +139,13 @@ pub(super) fn needs_normalization<'tcx, T: TypeVisitable<TyCtxt<'tcx>>>(
// so we can ignore those.
match infcx.typing_mode_raw().assert_not_erased() {
// FIXME(#132279): We likely want to reveal opaques during post borrowck analysis
TypingMode::Coherence
| TypingMode::Typeck { .. }
TypingMode::Typeck { .. }
| TypingMode::PostTypeckUntilBorrowck { .. }
| TypingMode::PostBorrowck { .. } => flags.remove(ty::TypeFlags::HAS_TY_OPAQUE),
TypingMode::Reflection | TypingMode::PostAnalysis | TypingMode::Codegen => {}
TypingMode::Coherence => {
unreachable!("old solver coherence")
}
}
value.has_type_flags(flags)
@@ -426,8 +428,7 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
// Only normalize `impl Trait` outside of type inference, usually in codegen.
match self.selcx.typing_mode() {
// FIXME(#132279): We likely want to reveal opaques during post borrowck analysis
TypingMode::Coherence
| TypingMode::Typeck { .. }
TypingMode::Typeck { .. }
| TypingMode::PostTypeckUntilBorrowck { .. }
| TypingMode::PostBorrowck { .. } => ty.super_fold_with(self),
TypingMode::Reflection | TypingMode::PostAnalysis | TypingMode::Codegen => {
@@ -449,6 +450,9 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
self.depth -= 1;
folded_ty
}
TypingMode::Coherence => {
unreachable!("old solver coherence")
}
}
}

View File

@@ -1034,8 +1034,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
// transmute checking and polymorphic MIR optimizations could
// get a result which isn't correct for all monomorphizations.
match selcx.typing_mode() {
TypingMode::Coherence
| TypingMode::Typeck { .. }
TypingMode::Typeck { .. }
| TypingMode::PostTypeckUntilBorrowck { .. }
| TypingMode::Reflection
| TypingMode::PostBorrowck { .. } => {
@@ -1053,6 +1052,9 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
selcx.infcx.deeply_resolve_ignoring_regions(trait_ref);
!poly_trait_ref.still_further_specializable()
}
TypingMode::Coherence => {
unreachable!("old solver coherence")
}
}
}
}

View File

@@ -231,8 +231,7 @@ impl<'a, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'a, 'tcx> {
ty::Opaque { def_id } => {
// Only normalize `impl Trait` outside of type inference, usually in codegen.
match self.infcx.typing_mode_raw().assert_not_erased() {
TypingMode::Coherence
| TypingMode::Typeck { .. }
TypingMode::Typeck { .. }
| TypingMode::PostTypeckUntilBorrowck { .. }
| TypingMode::PostBorrowck { .. } => ty.try_super_fold_with(self)?,
@@ -268,6 +267,9 @@ impl<'a, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'a, 'tcx> {
self.anon_depth -= 1;
folded_ty?
}
TypingMode::Coherence => {
unreachable!("old solver coherence")
}
}
}

View File

@@ -845,6 +845,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
}
ty::Alias(_, ty::AliasTy { kind: ty::Opaque { def_id }, .. }) => {
debug_assert!(!self.typing_mode().is_coherence(), "old solver coherence");
if candidates.vec.iter().any(|c| matches!(c, ProjectionCandidate { .. })) {
// We do not generate an auto impl candidate for `impl Trait`s which already
// reference our auto trait.
@@ -855,10 +857,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
//
// Note that this is only sound as projection candidates of opaque types
// are always applicable for auto traits.
} else if self.typing_mode().is_coherence() {
// We do not emit auto trait candidates for opaque types in coherence.
// Doing so can result in weird dependency cycles.
candidates.ambiguous = true;
} else if self.infcx.can_define_opaque_ty(def_id) {
// We do not emit auto trait candidates for opaque types in their defining scope, as
// we need to know the hidden type first, which we can't reliably know within the defining

View File

@@ -35,7 +35,6 @@ use tracing::{debug, instrument, trace};
use self::EvaluationResult::*;
use self::SelectionCandidate::*;
use super::coherence::{self, Conflict};
use super::project::ProjectionTermObligation;
use super::util::closure_trait_ref_and_return_type;
use super::{
@@ -106,14 +105,6 @@ pub struct SelectionContext<'cx, 'tcx> {
/// require themselves.
freshener: TypeFreshener<'cx, 'tcx>,
/// If `intercrate` is set, we remember predicates which were
/// considered ambiguous because of impls potentially added in other crates.
/// This is used in coherence to give improved diagnostics.
/// We don't do his until we detect a coherence error because it can
/// lead to false overflow results (#47139) and because always
/// computing it may negatively impact performance.
intercrate_ambiguity_causes: Option<FxIndexSet<IntercrateAmbiguityCause<'tcx>>>,
/// The mode that trait queries run in, which informs our error handling
/// policy. In essence, canonicalized queries need their errors propagated
/// rather than immediately reported because we do not have accurate spans.
@@ -191,7 +182,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
SelectionContext {
infcx,
freshener: TypeFreshener::new(infcx),
intercrate_ambiguity_causes: None,
query_mode: TraitQueryMode::Standard,
}
}
@@ -208,27 +198,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
SelectionContext { query_mode, ..SelectionContext::new(infcx) }
}
/// Enables tracking of intercrate ambiguity causes. See
/// the documentation of [`Self::intercrate_ambiguity_causes`] for more.
pub fn enable_tracking_intercrate_ambiguity_causes(&mut self) {
assert!(self.typing_mode().is_coherence());
assert!(self.intercrate_ambiguity_causes.is_none());
self.intercrate_ambiguity_causes = Some(FxIndexSet::default());
debug!("selcx: enable_tracking_intercrate_ambiguity_causes");
}
/// Gets the intercrate ambiguity causes collected since tracking
/// was enabled and disables tracking at the same time. If
/// tracking is not enabled, just returns an empty vector.
pub fn take_intercrate_ambiguity_causes(
&mut self,
) -> FxIndexSet<IntercrateAmbiguityCause<'tcx>> {
assert!(self.typing_mode().is_coherence());
self.intercrate_ambiguity_causes.take().unwrap_or_default()
}
pub fn tcx(&self) -> TyCtxt<'tcx> {
self.infcx.tcx
}
@@ -363,42 +332,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
&mut self,
stack: &TraitObligationStack<'o, 'tcx>,
) -> SelectionResult<'tcx, SelectionCandidate<'tcx>> {
if let Err(conflict) = self.is_knowable(stack) {
debug!("coherence stage: not knowable");
if self.intercrate_ambiguity_causes.is_some() {
debug!("evaluate_stack: intercrate_ambiguity_causes is some");
// Heuristics: show the diagnostics when there are no candidates in crate.
if let Ok(candidate_set) = self.assemble_candidates(stack) {
let mut no_candidates_apply = true;
for c in candidate_set.vec.iter() {
if self.evaluate_candidate(stack, c)?.may_apply() {
no_candidates_apply = false;
break;
}
}
if !candidate_set.ambiguous && no_candidates_apply {
let trait_ref = self.infcx.deeply_resolve_ignoring_regions(
stack.obligation.predicate.skip_binder().trait_ref,
);
if !trait_ref.references_error() {
let self_ty = trait_ref.self_ty();
let self_ty = self_ty.has_concrete_skeleton().then(|| self_ty);
let cause = if let Conflict::Upstream = conflict {
IntercrateAmbiguityCause::UpstreamCrateUpdate { trait_ref, self_ty }
} else {
IntercrateAmbiguityCause::DownstreamCrate { trait_ref, self_ty }
};
debug!(?cause, "evaluate_stack: pushing cause");
self.intercrate_ambiguity_causes.as_mut().unwrap().insert(cause);
}
}
}
}
return Ok(None);
}
let candidate_set = self.assemble_candidates(stack)?;
if candidate_set.ambiguous {
@@ -1000,8 +933,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
previous_stack: TraitObligationStackList<'o, 'tcx>,
mut obligation: PolyTraitObligation<'tcx>,
) -> Result<EvaluationResult, OverflowError> {
if !self.typing_mode().is_coherence()
&& obligation.is_global()
debug_assert!(!self.typing_mode().is_coherence(), "old solver coherence");
if obligation.is_global()
&& obligation.param_env.caller_bounds().all(|bound| bound.has_param())
{
// If a param env has no global bounds, global obligations do not
@@ -1432,30 +1366,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
candidates
}
fn is_knowable<'o>(&mut self, stack: &TraitObligationStack<'o, 'tcx>) -> Result<(), Conflict> {
let obligation = &stack.obligation;
match self.typing_mode() {
TypingMode::Coherence => {}
TypingMode::Typeck { .. }
| TypingMode::PostTypeckUntilBorrowck { .. }
| TypingMode::Reflection
| TypingMode::PostBorrowck { .. }
| TypingMode::PostAnalysis
| TypingMode::Codegen => return Ok(()),
}
debug!("is_knowable()");
let predicate = self.infcx.deeply_resolve_ignoring_regions(obligation.predicate);
// Okay to skip binder because of the nature of the
// trait-ref-is-knowable check, which does not care about
// bound regions.
let trait_ref = predicate.skip_binder().trait_ref;
coherence::trait_ref_is_knowable(self.infcx, trait_ref, |ty| Ok::<_, !>(ty)).into_ok()
}
/// Returns `true` if the global caches can be used.
fn can_use_global_caches(
&self,
@@ -1470,13 +1380,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
}
match self.typing_mode() {
// Avoid using the global cache during coherence and just rely
// on the local cache. It is really just a simplification to
// avoid us having to fear that coherence results "pollute"
// the master cache. Since coherence executes pretty quickly,
// it's not worth going to more trouble to increase the
// hit-rate, I don't think.
TypingMode::Coherence => false,
// Avoid using the global cache when we're defining opaque types
// as their hidden type may impact the result of candidate selection.
//
@@ -1502,6 +1405,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// FIXME(#132279): This is still incorrect as we treat opaque types
// and default associated items differently between these two modes.
TypingMode::PostAnalysis | TypingMode::Codegen => true,
TypingMode::Coherence => {
unreachable!("old solver coherence")
}
}
}
@@ -2528,14 +2434,16 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
return Err(());
}
TypingMode::Coherence
| TypingMode::Typeck { .. }
TypingMode::Typeck { .. }
| TypingMode::PostTypeckUntilBorrowck { .. }
| TypingMode::PostBorrowck { .. }
| TypingMode::Codegen
| TypingMode::ErasedNotCoherence(_)
| TypingMode::Reflection
| TypingMode::PostAnalysis => {}
TypingMode::Coherence => {
unreachable!("old solver coherence")
}
}
Ok(Normalized { value: impl_args, obligations: nested_obligations })
@@ -2876,12 +2784,14 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
TypingMode::Typeck { defining_opaque_types_and_generators: stalled_generators } => {
def_id.as_local().is_some_and(|def_id| stalled_generators.contains(&def_id))
}
TypingMode::Coherence
| TypingMode::PostAnalysis
TypingMode::PostAnalysis
| TypingMode::Reflection
| TypingMode::Codegen
| TypingMode::PostTypeckUntilBorrowck { defining_opaque_types: _ }
| TypingMode::PostBorrowck { defined_opaque_types: _ } => false,
TypingMode::Coherence => {
unreachable!("old solver coherence")
}
}
}
}

View File

@@ -1,4 +1,4 @@
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
// test that a `<T as AliasHaver>::Assoc: '!a_u1` constraint is considered to be satisfied
// if there's a `T::Assoc: 'static` assumption in the root universe and if not that it is

View File

@@ -1,4 +1,4 @@
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
//@ check-pass
#![feature(generic_const_items)]

View File

@@ -1,4 +1,4 @@
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
//@ needs-rustc-debug-assertions
// Regression test for #161067. A nested non-rigid alias must be normalized

View File

@@ -1,4 +1,4 @@
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
trait Trait<T> {}

View File

@@ -1,5 +1,5 @@
//@ check-pass
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
#![feature(test_binder_constraints, non_lifetime_binders)]
#![expect(incomplete_features)]

View File

@@ -1,4 +1,4 @@
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
// Regression test for an ICE in the `MaxUniverse` region visitor. When computing
// the max universe of a region constraint, a `ReVar` term could already have been

View File

@@ -1,5 +1,5 @@
//@ check-pass
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
#![feature(test_binder_constraints, non_lifetime_binders)]
#![expect(incomplete_features)]

View File

@@ -1,4 +1,4 @@
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
#![feature(test_binder_constraints)]
#![expect(incomplete_features)]

View File

@@ -1,5 +1,5 @@
//@ check-pass
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
#![feature(test_binder_constraints, non_lifetime_binders)]
#![expect(incomplete_features)]

View File

@@ -1,5 +1,5 @@
//@ check-pass
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
// Regression test for rust-lang/project-assumptions-on-binders#19, based on the `syn` failure.
// The receiver gives us an implied `I: 'b` bound and `'b: 'a` lets that satisfy the object

View File

@@ -1,5 +1,5 @@
//@ check-pass
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
#![crate_type = "lib"]

View File

@@ -1,5 +1,5 @@
//@ check-pass
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
#![crate_type = "lib"]

View File

@@ -1,5 +1,5 @@
//@ check-pass
//@ compile-flags: -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally
#![crate_type = "lib"]

View File

@@ -1,5 +1,3 @@
//@ compile-flags: -Znext-solver=coherence
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

View File

@@ -1,11 +1,11 @@
error[E0425]: cannot find value `x` in this scope
--> $DIR/error_in_ty.rs:6:31
--> $DIR/error_in_ty.rs:4:31
|
LL | pub struct A<const z: [usize; x]> {}
| ^ not found in this scope
|
note: similarly named const parameter `z` defined here
--> $DIR/error_in_ty.rs:6:20
--> $DIR/error_in_ty.rs:4:20
|
LL | pub struct A<const z: [usize; x]> {}
| ^
@@ -16,7 +16,7 @@ LL + pub struct A<const z: [usize; z]> {}
|
error: `[usize; x]` is forbidden as the type of a const generic parameter
--> $DIR/error_in_ty.rs:6:23
--> $DIR/error_in_ty.rs:4:23
|
LL | pub struct A<const z: [usize; x]> {}
| ^^^^^^^^^^
@@ -28,31 +28,31 @@ LL + #![feature(min_adt_const_params)]
|
error[E0308]: mismatched types
--> $DIR/error_in_ty.rs:10:8
--> $DIR/error_in_ty.rs:8:8
|
LL | impl A<2> {
| ^ expected `[usize; x]`, found integer
|
note: expected because of the type of the const parameter
--> $DIR/error_in_ty.rs:6:14
--> $DIR/error_in_ty.rs:4:14
|
LL | pub struct A<const z: [usize; x]> {}
| ^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/error_in_ty.rs:16:8
--> $DIR/error_in_ty.rs:14:8
|
LL | impl A<2> {
| ^ expected `[usize; x]`, found integer
|
note: expected because of the type of the const parameter
--> $DIR/error_in_ty.rs:6:14
--> $DIR/error_in_ty.rs:4:14
|
LL | pub struct A<const z: [usize; x]> {}
| ^^^^^^^^^^^^^^^^^^^
error[E0592]: duplicate definitions with name `B`
--> $DIR/error_in_ty.rs:12:5
--> $DIR/error_in_ty.rs:10:5
|
LL | pub const fn B() {}
| ^^^^^^^^^^^^^^^^ duplicate definitions for `B`

View File

@@ -1,31 +0,0 @@
error[E0119]: conflicting implementations of trait `CoerceUnsized<&Wrapper<_>>` for type `&Wrapper<_>`
--> $DIR/E0476.rs:12:1
|
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<'a, 'b, T, U> CoerceUnsized<&'a U> for &'b T
where 'b: 'a, T: Unsize<U>, T: ?Sized, U: ?Sized;
error[E0476]: lifetime of the source pointer does not outlive lifetime bound of the object type
--> $DIR/E0476.rs:12:1
|
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: object type is valid for the lifetime `'a` as defined here
--> $DIR/E0476.rs:12:6
|
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
| ^^
note: source pointer is only valid for the lifetime `'b` as defined here
--> $DIR/E0476.rs:12:10
|
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
| ^^
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0119, E0476.
For more information about an error, try `rustc --explain E0119`.

View File

@@ -1,6 +1,3 @@
//@ revisions: old next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver=coherence
#![feature(coerce_unsized)]
#![feature(unsize)]

View File

@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `CoerceUnsized<&Wrapper<_>>` for type `&Wrapper<_>`
--> $DIR/E0476.rs:12:1
--> $DIR/E0476.rs:9:1
|
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,18 +9,18 @@ LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S
where 'b: 'a, T: Unsize<U>, T: ?Sized, U: ?Sized;
error[E0476]: lifetime of the source pointer does not outlive lifetime bound of the object type
--> $DIR/E0476.rs:12:1
--> $DIR/E0476.rs:9:1
|
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: object type is valid for the lifetime `'a` as defined here
--> $DIR/E0476.rs:12:6
--> $DIR/E0476.rs:9:6
|
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
| ^^
note: source pointer is only valid for the lifetime `'b` as defined here
--> $DIR/E0476.rs:12:10
--> $DIR/E0476.rs:9:10
|
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
| ^^

View File

@@ -1,5 +1,3 @@
//@ compile-flags: -Znext-solver=coherence
#![feature(const_trait_impl)]
const trait Foo {}

View File

@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Foo` for type `i32`
--> $DIR/ice-124857-combine-effect-const-infer-vars.rs:9:1
--> $DIR/ice-124857-combine-effect-const-infer-vars.rs:7:1
|
LL | const impl Foo for i32 {}
| ---------------------- first implementation here

View File

@@ -1,6 +1,3 @@
//@ revisions: old next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver=coherence
//@ check-pass
// Regression test for issue #90662

View File

@@ -1,4 +1,3 @@
//@ compile-flags: -Znext-solver=coherence
//@ check-pass
// A regression test for #124791. Computing ambiguity causes

View File

@@ -1,5 +1,3 @@
//@ compile-flags: -Znext-solver=coherence
// A regression test for #124791. Computing ambiguity causes
// for the overlap of the `ToString` impls caused an ICE.
#![crate_type = "lib"]

View File

@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Overlap` for type `str`
--> $DIR/ambiguity-causes-canonical-state-ice-2.rs:18:1
--> $DIR/ambiguity-causes-canonical-state-ice-2.rs:16:1
|
LL | impl<T: ToOwned<Owned = i8> + ?Sized> Overlap for T {}
| --------------------------------------------------- first implementation here

View File

@@ -4,8 +4,6 @@
// takes multiple minutes when doing so and less than a second
// otherwise.
//@ compile-flags: -Znext-solver=coherence
trait RecursiveSuper:
Super<
A0 = Self::Assoc,

View File

@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Overlap` for type `Box<_>`
--> $DIR/ambiguity-causes-visitor-hang.rs:53:1
--> $DIR/ambiguity-causes-visitor-hang.rs:51:1
|
LL | impl<T: RecursiveSuper> Overlap for T {}
| ------------------------------------- first implementation here

View File

@@ -1,5 +1,3 @@
//@ compile-flags: -Znext-solver=coherence
#![feature(rustc_attrs)]
#![rustc_no_implicit_bounds]
#![recursion_limit = "10"]

View File

@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Trait` for type `W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<_>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/coherence-fulfill-overflow.rs:14:1
--> $DIR/coherence-fulfill-overflow.rs:12:1
|
LL | impl<T: TwoW> Trait for W<T> {}
| ---------------------------- first implementation here

View File

@@ -1,4 +1,3 @@
//@ compile-flags: -Znext-solver=coherence
//@ check-pass
//@ aux-build:coherence-unknowable-does-not-eagerly-normalize-dep.rs
//

View File

@@ -1,5 +1,3 @@
//@ compile-flags: -Znext-solver=coherence
// Makes sure we don't ICE on associated const projection when the feature gate
// is not enabled, since we should avoid encountering ICEs on stable if possible.

View File

@@ -1,5 +1,5 @@
error[E0658]: associated const equality is incomplete
--> $DIR/dont-ice-on-assoc-projection.rs:15:32
--> $DIR/dont-ice-on-assoc-projection.rs:13:32
|
LL | impl<T> Foo for T where T: Bar<ASSOC = 0> {}
| ^^^^^^^^^
@@ -9,7 +9,7 @@ LL | impl<T> Foo for T where T: Bar<ASSOC = 0> {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0119]: conflicting implementations of trait `Foo` for type `()`
--> $DIR/dont-ice-on-assoc-projection.rs:15:1
--> $DIR/dont-ice-on-assoc-projection.rs:13:1
|
LL | impl Foo for () {}
| --------------- first implementation here

View File

@@ -1,6 +1,3 @@
//@ revisions: current next
//@[next] compile-flags: -Znext-solver=coherence
//@ ignore-compare-mode-next-solver (explicit revisions)
//@ check-pass
// A regression test for `paperclip-core`. This previously failed to compile

View File

@@ -1,6 +1,5 @@
//@ check-pass
//@ revisions: ai ia ii
//@ compile-flags: -Znext-solver=coherence
// Regression test for nalgebra hang <https://github.com/rust-lang/rust/issues/130056>.

View File

@@ -1,4 +1,3 @@
//@ compile-flags: -Znext-solver=coherence
//@ check-pass
#![feature(rustc_attrs)]
#![rustc_no_implicit_bounds]