Skip to content

Commit

Permalink
Rollup merge of #131542 - lcnr:new-solver-fixmes, r=compiler-errors
Browse files Browse the repository at this point in the history
next-solver: remove outdated FIXMEs

r? `@compiler-errors`
  • Loading branch information
matthiaskrgr authored Oct 11, 2024
2 parents 7f79c1e + 5fd7be9 commit b18e1aa
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ where
for &arg in &state.value.var_values.var_values.as_slice()
[orig_values.len()..state.value.var_values.len()]
{
// FIXME: This is so ugly.
let unconstrained = delegate.fresh_var_for_kind_with_span(arg, span);
orig_values.push(unconstrained);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ where
#[derive_where(Clone, Debug, Default; I: Interner)]
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(feature = "nightly", derive(TyDecodable, TyEncodable, HashStable_NoContext))]
// FIXME: This can be made crate-private once `EvalCtxt` also lives in this crate.
struct NestedGoals<I: Interner> {
/// These normalizes-to goals are treated specially during the evaluation
/// loop. In each iteration we take the RHS of the projection, replace it with
Expand Down Expand Up @@ -421,6 +420,7 @@ where
let (normalization_nested_goals, certainty) =
self.instantiate_and_apply_query_response(goal.param_env, orig_values, response);
self.inspect.goal_evaluation(goal_evaluation);

// FIXME: We previously had an assert here that checked that recomputing
// a goal after applying its constraints did not change its response.
//
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_next_trait_solver/src/solve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
//!
//! For a high-level overview of how this solver works, check out the relevant
//! section of the rustc-dev-guide.
//!
//! FIXME(@lcnr): Write that section. If you read this before then ask me
//! about it on zulip.
mod alias_relate;
mod assembly;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ where
for ty in types.iter() {
// We can't find the intersection if the types used are generic.
//
// FIXME(effects) do we want to look at where clauses to get some
// FIXME(effects): do we want to look at where clauses to get some
// clue for the case where generic types are being used?
let Some(kind) = ty::EffectKind::try_from_ty(cx, ty) else {
return Err(NoSolution);
Expand Down
11 changes: 2 additions & 9 deletions compiler/rustc_next_trait_solver/src/solve/trait_goals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ where
ecx: &mut EvalCtxt<'_, D>,
_guar: I::ErrorGuaranteed,
) -> Result<Candidate<I>, NoSolution> {
// FIXME: don't need to enter a probe here.
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
}
Expand Down Expand Up @@ -463,7 +462,6 @@ where
// Async coroutine unconditionally implement `Future`
// Technically, we need to check that the future output type is Sized,
// but that's already proven by the coroutine being WF.
// FIXME: use `consider_implied`
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
}
Expand All @@ -489,7 +487,6 @@ where
// Gen coroutines unconditionally implement `Iterator`
// Technically, we need to check that the iterator output type is Sized,
// but that's already proven by the coroutines being WF.
// FIXME: use `consider_implied`
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
}
Expand All @@ -512,8 +509,7 @@ where
return Err(NoSolution);
}

// Gen coroutines unconditionally implement `FusedIterator`
// FIXME: use `consider_implied`
// Gen coroutines unconditionally implement `FusedIterator`.
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
}
Expand All @@ -539,7 +535,6 @@ where
// Gen coroutines unconditionally implement `Iterator`
// Technically, we need to check that the iterator output type is Sized,
// but that's already proven by the coroutines being WF.
// FIXME: use `consider_implied`
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
}
Expand Down Expand Up @@ -610,7 +605,7 @@ where
return Err(NoSolution);
}

// FIXME(-Znext-solver): Implement this when we get const working in the new solver
// FIXME(effects): Implement this when we get const working in the new solver

// `Destruct` is automatically implemented for every type in
// non-const environments.
Expand All @@ -631,8 +626,6 @@ where
return Err(NoSolution);
}

// FIXME: This actually should destructure the `Result` we get from transmutability and
// register candidates. We probably need to register >1 since we may have an OR of ANDs.
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc).enter(|ecx| {
let certainty = ecx.is_transmutable(
goal.param_env,
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_trait_selection/src/solve/delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
if eligible { Ok(Some(node_item.item.def_id)) } else { Ok(None) }
}

// FIXME: This actually should destructure the `Result` we get from transmutability and
// register candidates. We probably need to register >1 since we may have an OR of ANDs.
fn is_transmutable(
&self,
param_env: ty::ParamEnv<'tcx>,
Expand Down

0 comments on commit b18e1aa

Please sign in to comment.