implement and use NormalizesTo
This commit is contained in:
23
compiler/rustc_trait_selection/src/solve/project_goals.rs
Normal file
23
compiler/rustc_trait_selection/src/solve/project_goals.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use super::EvalCtxt;
|
||||
use rustc_middle::traits::solve::{Certainty, Goal, QueryResult};
|
||||
use rustc_middle::ty::{self, ProjectionPredicate};
|
||||
|
||||
impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
#[instrument(level = "debug", skip(self), ret)]
|
||||
pub(super) fn compute_projection_goal(
|
||||
&mut self,
|
||||
goal: Goal<'tcx, ProjectionPredicate<'tcx>>,
|
||||
) -> QueryResult<'tcx> {
|
||||
match goal.predicate.term.unpack() {
|
||||
ty::TermKind::Ty(term) => {
|
||||
let alias = goal.predicate.projection_ty.to_ty(self.tcx());
|
||||
self.eq(goal.param_env, alias, term)?;
|
||||
self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
|
||||
}
|
||||
// FIXME(associated_const_equality): actually do something here.
|
||||
ty::TermKind::Const(_) => {
|
||||
self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user