Use EarlyBinder in rustc_type_ir, simplify imports · rust-lang/rust@f922929 (original) (raw)
`@@ -7,26 +7,22 @@ use crate::inherent::*;
`
7
7
`use crate::ir_print::IrPrint;
`
8
8
`use crate::solve::inspect::CanonicalGoalEvaluationStep;
`
9
9
`use crate::visit::{Flags, TypeSuperVisitable, TypeVisitable};
`
10
``
`-
use crate::{
`
11
``
`-
AliasTerm, AliasTermKind, AliasTy, AliasTyKind, CanonicalVarInfo, CoercePredicate,
`
12
``
`-
DebugWithInfcx, ExistentialProjection, ExistentialTraitRef, FnSig, GenericArgKind,
`
13
``
`-
NormalizesTo, ProjectionPredicate, SubtypePredicate, TermKind, TraitPredicate, TraitRef,
`
14
``
`-
};
`
``
10
`+
use crate::{self as ty, DebugWithInfcx};
`
15
11
``
16
12
`pub trait Interner:
`
17
13
`Sized
`
18
14
` + Copy
`
19
``
`-
- IrPrint<AliasTy>
`
20
``
`-
- IrPrint<AliasTerm>
`
21
``
`-
- IrPrint<TraitRef>
`
22
``
`-
- IrPrint<TraitPredicate>
`
23
``
`-
- IrPrint<ExistentialTraitRef>
`
24
``
`-
- IrPrint<ExistentialProjection>
`
25
``
`-
- IrPrint<ProjectionPredicate>
`
26
``
`-
- IrPrint<NormalizesTo>
`
27
``
`-
- IrPrint<SubtypePredicate>
`
28
``
`-
- IrPrint<CoercePredicate>
`
29
``
`-
- IrPrint<FnSig>
`
``
15
`+
- IrPrint<ty::AliasTy>
`
``
16
`+
- IrPrint<ty::AliasTerm>
`
``
17
`+
- IrPrint<ty::TraitRef>
`
``
18
`+
- IrPrint<ty::TraitPredicate>
`
``
19
`+
- IrPrint<ty::ExistentialTraitRef>
`
``
20
`+
- IrPrint<ty::ExistentialProjection>
`
``
21
`+
- IrPrint<ty::ProjectionPredicate>
`
``
22
`+
- IrPrint<ty::NormalizesTo>
`
``
23
`+
- IrPrint<ty::SubtypePredicate>
`
``
24
`+
- IrPrint<ty::CoercePredicate>
`
``
25
`+
- IrPrint<ty::FnSig>
`
30
26
`{
`
31
27
`type DefId: Copy + Debug + Hash + Eq + TypeVisitable;
`
32
28
`type AdtDef: Copy + Debug + Hash + Eq;
`
`@@ -39,9 +35,9 @@ pub trait Interner:
`
39
35
` + DebugWithInfcx
`
40
36
` + Hash
`
41
37
` + Eq
`
42
``
`-
- IntoKind<Kind = GenericArgKind>
`
``
38
`+
- IntoKind<Kind = ty::GenericArgKind>
`
43
39
` + TypeVisitable;
`
44
``
`-
type Term: Copy + Debug + Hash + Eq + IntoKind<Kind = TermKind> + TypeVisitable;
`
``
40
`+
type Term: Copy + Debug + Hash + Eq + IntoKind<Kind = ty::TermKind> + TypeVisitable;
`
45
41
``
46
42
`type BoundVarKinds: Copy
`
47
43
` + Debug
`
`@@ -51,7 +47,7 @@ pub trait Interner:
`
51
47
` + Default;
`
52
48
`type BoundVarKind: Copy + Debug + Hash + Eq;
`
53
49
``
54
``
`-
type CanonicalVars: Copy + Debug + Hash + Eq + IntoIterator<Item = CanonicalVarInfo>;
`
``
50
`+
type CanonicalVars: Copy + Debug + Hash + Eq + IntoIterator<Item = ty::CanonicalVarInfo>;
`
55
51
`type PredefinedOpaques: Copy + Debug + Hash + Eq;
`
56
52
`type DefiningOpaqueTypes: Copy + Debug + Hash + Default + Eq + TypeVisitable;
`
57
53
`type ExternalConstraints: Copy + Debug + Hash + Eq;
`
`@@ -99,23 +95,23 @@ pub trait Interner:
`
99
95
`type Clause: Clause;
`
100
96
`type Clauses: Copy + Debug + Hash + Eq + TypeSuperVisitable + Flags;
`
101
97
``
102
``
`-
fn mk_canonical_var_infos(self, infos: &[CanonicalVarInfo]) -> Self::CanonicalVars;
`
``
98
`+
fn mk_canonical_var_infos(self, infos: &[ty::CanonicalVarInfo]) -> Self::CanonicalVars;
`
103
99
``
104
100
`type GenericsOf: GenericsOf;
`
105
101
`fn generics_of(self, def_id: Self::DefId) -> Self::GenericsOf;
`
106
102
``
107
103
`` // FIXME: Remove after uplifting EarlyBinder
``
108
``
`-
fn type_of_instantiated(self, def_id: Self::DefId, args: Self::GenericArgs) -> Self::Ty;
`
``
104
`+
fn type_of(self, def_id: Self::DefId) -> ty::EarlyBinder<Self, Self::Ty>;
`
109
105
``
110
``
`-
fn alias_ty_kind(self, alias: AliasTy) -> AliasTyKind;
`
``
106
`+
fn alias_ty_kind(self, alias: ty::AliasTy) -> ty::AliasTyKind;
`
111
107
``
112
``
`-
fn alias_term_kind(self, alias: AliasTerm) -> AliasTermKind;
`
``
108
`+
fn alias_term_kind(self, alias: ty::AliasTerm) -> ty::AliasTermKind;
`
113
109
``
114
110
`fn trait_ref_and_own_args_for_alias(
`
115
111
`self,
`
116
112
`def_id: Self::DefId,
`
117
113
`args: Self::GenericArgs,
`
118
``
`-
) -> (TraitRef, Self::OwnItemArgs);
`
``
114
`+
) -> (ty::TraitRef, Self::OwnItemArgs);
`
119
115
``
120
116
`fn mk_args(self, args: &[Self::GenericArg]) -> Self::GenericArgs;
`
121
117
``