Skip to content

Commit 8e1dba4

Browse files
Move NormalizesTo back down
I tried to rebase this down into the first commit but it is WAY too annoying x
1 parent 2ed1bdb commit 8e1dba4

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

Cargo.lock

+2
Original file line numberDiff line numberDiff line change
@@ -4775,11 +4775,13 @@ dependencies = [
47754775
"rustc_next_trait_solver",
47764776
"rustc_parse_format",
47774777
"rustc_query_system",
4778+
"rustc_serialize",
47784779
"rustc_session",
47794780
"rustc_span",
47804781
"rustc_target",
47814782
"rustc_transmute",
47824783
"rustc_type_ir",
4784+
"rustc_type_ir_macros",
47834785
"smallvec",
47844786
"tracing",
47854787
]

compiler/rustc_trait_selection/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ rustc_middle = { path = "../rustc_middle" }
2222
rustc_next_trait_solver = { path = "../rustc_next_trait_solver" }
2323
rustc_parse_format = { path = "../rustc_parse_format" }
2424
rustc_query_system = { path = "../rustc_query_system" }
25+
rustc_serialize = { path = "../rustc_serialize" }
2526
rustc_session = { path = "../rustc_session" }
2627
rustc_span = { path = "../rustc_span" }
2728
rustc_target = { path = "../rustc_target" }
2829
rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] }
2930
rustc_type_ir = { path = "../rustc_type_ir" }
31+
rustc_type_ir_macros = { path = "../rustc_type_ir_macros" }
3032
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
3133
tracing = "0.1"
3234
# tidy-alphabetical-end

compiler/rustc_trait_selection/src/solve/eval_ctxt/mod.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use rustc_infer::infer::{
1111
use rustc_infer::traits::query::NoSolution;
1212
use rustc_infer::traits::solve::{MaybeCause, NestedNormalizationGoals};
1313
use rustc_infer::traits::ObligationCause;
14-
use rustc_macros::{extension, HashStable};
14+
use rustc_macros::{extension, HashStable, HashStable_NoContext, TyDecodable, TyEncodable};
1515
use rustc_middle::bug;
1616
use rustc_middle::infer::canonical::CanonicalVarInfos;
1717
use rustc_middle::traits::solve::{
18-
inspect, CanonicalInput, CanonicalResponse, Certainty, NestedGoals, PredefinedOpaques,
18+
inspect, CanonicalInput, CanonicalResponse, Certainty, PredefinedOpaques,
1919
PredefinedOpaquesData, QueryResult,
2020
};
2121
use rustc_middle::traits::specialization_graph;
@@ -25,6 +25,8 @@ use rustc_middle::ty::{
2525
};
2626
use rustc_session::config::DumpSolverProofTree;
2727
use rustc_span::DUMMY_SP;
28+
use rustc_type_ir::{self as ir, Interner};
29+
use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic};
2830

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

122124
impl<I: Interner> NestedGoals<I> {

compiler/rustc_type_ir/src/solve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::hash::Hash;
77
use rustc_macros::{HashStable_NoContext, TyDecodable, TyEncodable};
88
use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic};
99

10-
use crate::{Canonical, CanonicalVarValues, Interner, NormalizesTo, Upcast};
10+
use crate::{Canonical, CanonicalVarValues, Interner, Upcast};
1111

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

0 commit comments

Comments
 (0)