Skip to content

Commit

Permalink
Move NormalizesTo back down
Browse files Browse the repository at this point in the history
I tried to rebase this down into the first commit but it is WAY too
annoying x
  • Loading branch information
compiler-errors committed May 18, 2024
1 parent 2ed1bdb commit 8e1dba4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4775,11 +4775,13 @@ dependencies = [
"rustc_next_trait_solver",
"rustc_parse_format",
"rustc_query_system",
"rustc_serialize",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_transmute",
"rustc_type_ir",
"rustc_type_ir_macros",
"smallvec",
"tracing",
]
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_trait_selection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ rustc_middle = { path = "../rustc_middle" }
rustc_next_trait_solver = { path = "../rustc_next_trait_solver" }
rustc_parse_format = { path = "../rustc_parse_format" }
rustc_query_system = { path = "../rustc_query_system" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] }
rustc_type_ir = { path = "../rustc_type_ir" }
rustc_type_ir_macros = { path = "../rustc_type_ir_macros" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
# tidy-alphabetical-end
12 changes: 7 additions & 5 deletions compiler/rustc_trait_selection/src/solve/eval_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ use rustc_infer::infer::{
use rustc_infer::traits::query::NoSolution;
use rustc_infer::traits::solve::{MaybeCause, NestedNormalizationGoals};
use rustc_infer::traits::ObligationCause;
use rustc_macros::{extension, HashStable};
use rustc_macros::{extension, HashStable, HashStable_NoContext, TyDecodable, TyEncodable};
use rustc_middle::bug;
use rustc_middle::infer::canonical::CanonicalVarInfos;
use rustc_middle::traits::solve::{
inspect, CanonicalInput, CanonicalResponse, Certainty, NestedGoals, PredefinedOpaques,
inspect, CanonicalInput, CanonicalResponse, Certainty, PredefinedOpaques,
PredefinedOpaquesData, QueryResult,
};
use rustc_middle::traits::specialization_graph;
Expand All @@ -25,6 +25,8 @@ use rustc_middle::ty::{
};
use rustc_session::config::DumpSolverProofTree;
use rustc_span::DUMMY_SP;
use rustc_type_ir::{self as ir, Interner};
use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic};

use crate::traits::coherence;
use crate::traits::vtable::{count_own_vtable_entries, prepare_vtable_segments, VtblSegment};
Expand Down Expand Up @@ -101,7 +103,7 @@ pub struct EvalCtxt<'a, 'tcx> {
#[derive(derivative::Derivative)]
#[derivative(Clone(bound = ""), Debug(bound = ""), Default(bound = ""))]
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(feature = "nightly", derive(TyDecodable, TyEncodable, HashStable_NoContext))]
#[derive(TyDecodable, TyEncodable, HashStable_NoContext)]
// FIXME: This can be made crate-private once `EvalCtxt` also lives in this crate.
pub struct NestedGoals<I: Interner> {
/// These normalizes-to goals are treated specially during the evaluation
Expand All @@ -114,9 +116,9 @@ pub struct NestedGoals<I: Interner> {
///
/// Forgetting to replace the RHS with a fresh inference variable when we evaluate
/// this goal results in an ICE..
pub normalizes_to_goals: Vec<Goal<I, NormalizesTo<I>>>,
pub normalizes_to_goals: Vec<ir::solve::Goal<I, ir::NormalizesTo<I>>>,
/// The rest of the goals which have not yet processed or remain ambiguous.
pub goals: Vec<(GoalSource, Goal<I, I::Predicate>)>,
pub goals: Vec<(GoalSource, ir::solve::Goal<I, I::Predicate>)>,
}

impl<I: Interner> NestedGoals<I> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_type_ir/src/solve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::hash::Hash;
use rustc_macros::{HashStable_NoContext, TyDecodable, TyEncodable};
use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic};

use crate::{Canonical, CanonicalVarValues, Interner, NormalizesTo, Upcast};
use crate::{Canonical, CanonicalVarValues, Interner, Upcast};

pub type CanonicalInput<I, T = <I as Interner>::Predicate> = Canonical<I, QueryInput<I, T>>;
pub type CanonicalResponse<I> = Canonical<I, Response<I>>;
Expand Down

0 comments on commit 8e1dba4

Please sign in to comment.