1
Fork 0

update use of feature flags

This commit is contained in:
lcnr 2023-12-14 13:11:28 +01:00
parent 5d97ada1ec
commit 11d16c4082
218 changed files with 227 additions and 228 deletions

View file

@ -422,7 +422,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
self.compute_const_evaluatable_goal(Goal { param_env, predicate: ct })
}
ty::PredicateKind::ConstEquate(_, _) => {
bug!("ConstEquate should not be emitted when `-Ztrait-solver=next` is active")
bug!("ConstEquate should not be emitted when `-Znext-solver` is active")
}
ty::PredicateKind::NormalizesTo(predicate) => {
self.compute_normalizes_to_goal(Goal { param_env, predicate })

View file

@ -1,7 +1,6 @@
//! The next-generation trait solver, currently still WIP.
//!
//! As a user of rust, you can use `-Ztrait-solver=next` or `next-coherence`
//! to enable the new trait solver always, or just within coherence, respectively.
//! As a user of rust, you can use `-Znext-solver` to enable the new trait solver.
//!
//! As a developer of rustc, you shouldn't be using the new trait
//! solver without asking the trait-system-refactor-initiative, but it can
@ -248,7 +247,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
return None;
}
// FIXME(-Ztrait-solver=next): We should instead try to find a `Certainty::Yes` response with
// FIXME(-Znext-solver): We should instead try to find a `Certainty::Yes` response with
// a subset of the constraints that all the other responses have.
let one = responses[0];
if responses[1..].iter().all(|&resp| resp == one) {

View file

@ -445,7 +445,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
return Err(NoSolution);
}
// FIXME(-Ztrait-solver=next): Implement this when we get const working in the new solver
// FIXME(-Znext-solver): Implement this when we get const working in the new solver
// `Destruct` is automatically implemented for every type in
// non-const environments.

View file

@ -855,7 +855,7 @@ where
}
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
// Need to lazily normalize here in with `-Ztrait-solver=next-coherence`.
// Need to lazily normalize here in with `-Znext-solver=coherence`.
let ty = match (self.lazily_normalize_ty)(ty) {
Ok(ty) => ty,
Err(err) => return ControlFlow::Break(OrphanCheckEarlyExit::NormalizationFailure(err)),
@ -1069,7 +1069,7 @@ impl<'a, 'tcx> ProofTreeVisitor<'tcx> for AmbiguityCausesVisitor<'a, 'tcx> {
let lazily_normalize_ty = |ty: Ty<'tcx>| {
let mut fulfill_cx = <dyn TraitEngine<'tcx>>::new(infcx);
if matches!(ty.kind(), ty::Alias(..)) {
// FIXME(-Ztrait-solver=next-coherence): we currently don't
// FIXME(-Znext-solver=coherence): we currently don't
// normalize opaque types here, resulting in diverging behavior
// for TAITs.
match infcx

View file

@ -1669,7 +1669,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
)
.into(),
};
// FIXME(-Ztrait-solver=next): For diagnostic purposes, it would be nice
// FIXME(-Znext-solver): For diagnostic purposes, it would be nice
// to deeply normalize this type.
let normalized_term =
ocx.normalize(&obligation.cause, obligation.param_env, unnormalized_term);

View file

@ -315,7 +315,7 @@ pub fn normalize_param_env_or_error<'tcx>(
// We do not normalize types here as there is no backwards compatibility requirement
// for us to do so.
//
// FIXME(-Ztrait-solver=next): remove this hack since we have deferred projection equality
// FIXME(-Znext-solver): remove this hack since we have deferred projection equality
predicate.fold_with(&mut ConstNormalizer(tcx))
}),
)
@ -386,7 +386,7 @@ pub fn normalize_param_env_or_error<'tcx>(
/// Normalize a type and process all resulting obligations, returning any errors.
///
/// FIXME(-Ztrait-solver=next): This should be replaced by `At::deeply_normalize`
/// FIXME(-Znext-solver): This should be replaced by `At::deeply_normalize`
/// which has the same behavior with the new solver. Because using a separate
/// fulfillment context worsens caching in the old solver, `At::deeply_normalize`
/// is still lazy with the old solver as it otherwise negatively impacts perf.

View file

@ -67,7 +67,7 @@ pub trait NormalizeExt<'tcx> {
/// same goals in both a temporary and the shared context which negatively impacts
/// performance as these don't share caching.
///
/// FIXME(-Ztrait-solver=next): This has the same behavior as `traits::fully_normalize`
/// FIXME(-Znext-solver): This has the same behavior as `traits::fully_normalize`
/// in the new solver, but because of performance reasons, we currently reuse an
/// existing fulfillment context in the old solver. Once we also eagerly prove goals with
/// the old solver or have removed the old solver, remove `traits::fully_normalize` and

View file

@ -72,7 +72,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
let mut fulfill_cx = crate::solve::FulfillmentCtxt::new(self);
fulfill_cx.register_predicate_obligation(self, obligation.clone());
// True errors
// FIXME(-Ztrait-solver=next): Overflows are reported as ambig here, is that OK?
// FIXME(-Znext-solver): Overflows are reported as ambig here, is that OK?
if !fulfill_cx.select_where_possible(self).is_empty() {
Ok(EvaluationResult::EvaluatedToErr)
} else if !fulfill_cx.select_all_or_error(self).is_empty() {

View file

@ -29,7 +29,7 @@ where
ocx: &ObligationCtxt<'_, 'tcx>,
key: ParamEnvAnd<'tcx, Self>,
) -> Result<Self::QueryResponse, NoSolution> {
// FIXME(-Ztrait-solver=next): shouldn't be using old normalizer
// FIXME(-Znext-solver): shouldn't be using old normalizer
Ok(ocx.normalize(&ObligationCause::dummy(), key.param_env, key.value.value))
}
}

View file

@ -22,7 +22,7 @@ impl<'tcx> StructurallyNormalizeExt<'tcx> for At<'_, 'tcx> {
assert!(!ty.is_ty_var(), "should have resolved vars before calling");
if self.infcx.next_trait_solver() {
// FIXME(-Ztrait-solver=next): correctly handle
// FIXME(-Znext-solver): correctly handle
// overflow here.
for _ in 0..256 {
let ty::Alias(ty::Projection | ty::Inherent | ty::Weak, alias) = *ty.kind() else {