@@ -18,8 +18,6 @@ pub use self::BorrowKind::*;
18
18
pub use self :: IntVarValue :: * ;
19
19
pub use self :: Variance :: * ;
20
20
use crate :: error:: TypeMismatchReason ;
21
- use crate :: metadata:: ModChild ;
22
- use crate :: middle:: privacy:: EffectiveVisibilities ;
23
21
use crate :: mir:: { Body , GeneratorLayout } ;
24
22
use crate :: ty;
25
23
use crate :: ty:: fast_reject:: SimplifiedType ;
@@ -28,24 +26,20 @@ pub use adt::*;
28
26
pub use assoc:: * ;
29
27
pub use generics:: * ;
30
28
use rustc_ast as ast;
31
- use rustc_ast:: node_id:: NodeMap ;
32
29
use rustc_attr as attr;
33
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexMap , FxIndexSet } ;
30
+ use rustc_data_structures:: fx:: FxHashMap ;
34
31
use rustc_data_structures:: intern:: Interned ;
35
32
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
36
- use rustc_data_structures:: steal:: Steal ;
37
33
use rustc_hir as hir;
38
- use rustc_hir:: def:: { CtorKind , CtorOf , DefKind , DocLinkResMap , LifetimeRes , Res } ;
34
+ use rustc_hir:: def:: { CtorKind , CtorOf , DefKind , Res } ;
39
35
use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , LocalDefId , LocalDefIdMap } ;
40
36
use rustc_hir:: Node ;
41
- use rustc_index:: IndexVec ;
42
37
use rustc_macros:: HashStable ;
43
38
use rustc_serialize:: { Decodable , Encodable } ;
44
- use rustc_session:: lint:: LintBuffer ;
45
39
pub use rustc_session:: lint:: RegisteredTools ;
46
40
use rustc_span:: hygiene:: MacroKind ;
47
41
use rustc_span:: symbol:: { sym, Ident , Symbol } ;
48
- use rustc_span:: { ExpnId , ExpnKind , Span } ;
42
+ use rustc_span:: { ExpnKind , Span } ;
49
43
use rustc_target:: abi:: { Align , FieldIdx , Integer , IntegerType , VariantIdx } ;
50
44
pub use rustc_target:: abi:: { ReprFlags , ReprOptions } ;
51
45
use rustc_type_ir:: WithCachedTypeInfo ;
@@ -147,6 +141,7 @@ mod opaque_hidden_type;
147
141
mod param_env;
148
142
mod placeholder;
149
143
mod predicate;
144
+ mod resolver_outputs;
150
145
mod symbol_name;
151
146
mod term;
152
147
mod ty_; // FIXME: rename to `ty` once we don't import `crate::ty` here
@@ -166,75 +161,13 @@ pub use predicate::{
166
161
PolyTypeOutlivesPredicate , Predicate , PredicateKind , ProjectionPredicate ,
167
162
RegionOutlivesPredicate , SubtypePredicate , ToPredicate , TraitPredicate , TypeOutlivesPredicate ,
168
163
} ;
164
+ pub use resolver_outputs:: { ResolverAstLowering , ResolverGlobalCtxt , ResolverOutputs } ;
169
165
pub use symbol_name:: SymbolName ;
170
166
pub use term:: { Term , TermKind } ;
171
167
pub use ty_:: Ty ;
172
168
pub use variant_def:: VariantDef ;
173
169
pub use visibility:: Visibility ;
174
170
175
- pub struct ResolverOutputs {
176
- pub global_ctxt : ResolverGlobalCtxt ,
177
- pub ast_lowering : ResolverAstLowering ,
178
- }
179
-
180
- #[ derive( Debug ) ]
181
- pub struct ResolverGlobalCtxt {
182
- pub visibilities : FxHashMap < LocalDefId , Visibility > ,
183
- /// This field is used to decide whether we should make `PRIVATE_IN_PUBLIC` a hard error.
184
- pub has_pub_restricted : bool ,
185
- /// Item with a given `LocalDefId` was defined during macro expansion with ID `ExpnId`.
186
- pub expn_that_defined : FxHashMap < LocalDefId , ExpnId > ,
187
- pub effective_visibilities : EffectiveVisibilities ,
188
- pub extern_crate_map : FxHashMap < LocalDefId , CrateNum > ,
189
- pub maybe_unused_trait_imports : FxIndexSet < LocalDefId > ,
190
- pub module_children : LocalDefIdMap < Vec < ModChild > > ,
191
- pub glob_map : FxHashMap < LocalDefId , FxHashSet < Symbol > > ,
192
- pub main_def : Option < MainDefinition > ,
193
- pub trait_impls : FxIndexMap < DefId , Vec < LocalDefId > > ,
194
- /// A list of proc macro LocalDefIds, written out in the order in which
195
- /// they are declared in the static array generated by proc_macro_harness.
196
- pub proc_macros : Vec < LocalDefId > ,
197
- /// Mapping from ident span to path span for paths that don't exist as written, but that
198
- /// exist under `std`. For example, wrote `str::from_utf8` instead of `std::str::from_utf8`.
199
- pub confused_type_with_std_module : FxHashMap < Span , Span > ,
200
- pub doc_link_resolutions : FxHashMap < LocalDefId , DocLinkResMap > ,
201
- pub doc_link_traits_in_scope : FxHashMap < LocalDefId , Vec < DefId > > ,
202
- pub all_macro_rules : FxHashMap < Symbol , Res < ast:: NodeId > > ,
203
- }
204
-
205
- /// Resolutions that should only be used for lowering.
206
- /// This struct is meant to be consumed by lowering.
207
- #[ derive( Debug ) ]
208
- pub struct ResolverAstLowering {
209
- pub legacy_const_generic_args : FxHashMap < DefId , Option < Vec < usize > > > ,
210
-
211
- /// Resolutions for nodes that have a single resolution.
212
- pub partial_res_map : NodeMap < hir:: def:: PartialRes > ,
213
- /// Resolutions for import nodes, which have multiple resolutions in different namespaces.
214
- pub import_res_map : NodeMap < hir:: def:: PerNS < Option < Res < ast:: NodeId > > > > ,
215
- /// Resolutions for labels (node IDs of their corresponding blocks or loops).
216
- pub label_res_map : NodeMap < ast:: NodeId > ,
217
- /// Resolutions for lifetimes.
218
- pub lifetimes_res_map : NodeMap < LifetimeRes > ,
219
- /// Lifetime parameters that lowering will have to introduce.
220
- pub extra_lifetime_params_map : NodeMap < Vec < ( Ident , ast:: NodeId , LifetimeRes ) > > ,
221
-
222
- pub next_node_id : ast:: NodeId ,
223
-
224
- pub node_id_to_def_id : FxHashMap < ast:: NodeId , LocalDefId > ,
225
- pub def_id_to_node_id : IndexVec < LocalDefId , ast:: NodeId > ,
226
-
227
- pub trait_map : NodeMap < Vec < hir:: TraitCandidate > > ,
228
- /// A small map keeping true kinds of built-in macros that appear to be fn-like on
229
- /// the surface (`macro` items in libcore), but are actually attributes or derives.
230
- pub builtin_macro_kinds : FxHashMap < LocalDefId , MacroKind > ,
231
- /// List functions and methods for which lifetime elision was successful.
232
- pub lifetime_elision_allowed : FxHashSet < ast:: NodeId > ,
233
-
234
- /// Lints that were emitted by the resolver and early lints.
235
- pub lint_buffer : Steal < LintBuffer > ,
236
- }
237
-
238
171
#[ derive( Clone , Copy , Debug ) ]
239
172
pub struct MainDefinition {
240
173
pub res : Res < ast:: NodeId > ,
0 commit comments