11// The crate store - a central repo for information collected about external
22// crates and libraries
33
4- use crate :: rmeta;
4+ use crate :: rmeta:: { CrateRoot , ImportedSourceFile , Lazy , MetadataBlob } ;
55use rustc:: dep_graph:: DepNodeIndex ;
66use rustc:: hir:: def_id:: { CrateNum , DefIndex } ;
77use rustc:: hir:: map:: definitions:: DefPathTable ;
88use rustc:: middle:: cstore:: { CrateSource , DepKind , ExternCrate } ;
99use rustc:: mir:: interpret:: AllocDecodingState ;
1010use rustc_index:: vec:: IndexVec ;
1111use rustc:: util:: nodemap:: FxHashMap ;
12- use rustc_data_structures:: sync:: { Lrc , Lock , MetadataRef , Once , AtomicCell } ;
12+ use rustc_data_structures:: sync:: { Lrc , Lock , Once , AtomicCell } ;
1313use rustc_data_structures:: svh:: Svh ;
1414use syntax:: ast;
1515use syntax:: edition:: Edition ;
1616use syntax_expand:: base:: SyntaxExtension ;
1717use syntax:: expand:: allocator:: AllocatorKind ;
18- use syntax_pos;
1918use proc_macro:: bridge:: client:: ProcMacro ;
2019
2120pub use crate :: rmeta:: { provide, provide_extern} ;
@@ -26,19 +25,6 @@ pub use crate::rmeta::{provide, provide_extern};
2625// own crate numbers.
2726crate type CrateNumMap = IndexVec < CrateNum , CrateNum > ;
2827
29- crate struct MetadataBlob ( pub MetadataRef ) ;
30-
31- /// Holds information about a syntax_pos::SourceFile imported from another crate.
32- /// See `imported_source_files()` for more information.
33- crate struct ImportedSourceFile {
34- /// This SourceFile's byte-offset within the source_map of its original crate
35- pub original_start_pos : syntax_pos:: BytePos ,
36- /// The end of this SourceFile within the source_map of its original crate
37- pub original_end_pos : syntax_pos:: BytePos ,
38- /// The imported SourceFile's representation within the local source_map
39- pub translated_source_file : Lrc < syntax_pos:: SourceFile > ,
40- }
41-
4228crate struct CrateMetadata {
4329 /// The primary crate data - binary metadata blob.
4430 crate blob : MetadataBlob ,
@@ -50,7 +36,7 @@ crate struct CrateMetadata {
5036 /// lifetime is only used behind `Lazy`, and therefore acts like an
5137 /// universal (`for<'tcx>`), that is paired up with whichever `TyCtxt`
5238 /// is being used to decode those values.
53- crate root : rmeta :: CrateRoot < ' static > ,
39+ crate root : CrateRoot < ' static > ,
5440 /// For each definition in this crate, we encode a key. When the
5541 /// crate is loaded, we read all the keys and put them in this
5642 /// hashmap, which gives the reverse mapping. This allows us to
@@ -60,7 +46,7 @@ crate struct CrateMetadata {
6046 /// Trait impl data.
6147 /// FIXME: Used only from queries and can use query cache,
6248 /// so pre-decoding can probably be avoided.
63- crate trait_impls : FxHashMap < ( u32 , DefIndex ) , rmeta :: Lazy < [ DefIndex ] > > ,
49+ crate trait_impls : FxHashMap < ( u32 , DefIndex ) , Lazy < [ DefIndex ] > > ,
6450 /// Proc macro descriptions for this crate, if it's a proc macro crate.
6551 crate raw_proc_macros : Option < & ' static [ ProcMacro ] > ,
6652 /// Source maps for code from the crate.
0 commit comments