@@ -21,15 +21,17 @@ extern crate tracing;
21
21
#[ macro_use]
22
22
extern crate rustc_middle;
23
23
24
+ use rustc_ast as ast;
24
25
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
25
26
use rustc_data_structures:: sync:: Lrc ;
26
27
use rustc_hir:: def_id:: CrateNum ;
27
28
use rustc_hir:: LangItem ;
28
29
use rustc_middle:: dep_graph:: WorkProduct ;
29
- use rustc_middle:: middle:: cstore:: { CrateSource , LibSource , NativeLib } ;
30
+ use rustc_middle:: middle:: cstore:: { self , CrateSource , LibSource } ;
30
31
use rustc_middle:: middle:: dependency_format:: Dependencies ;
31
32
use rustc_middle:: ty:: query:: Providers ;
32
33
use rustc_session:: config:: { OutputFilenames , OutputType , RUST_CGU_EXT } ;
34
+ use rustc_session:: utils:: NativeLibKind ;
33
35
use rustc_span:: symbol:: Symbol ;
34
36
use std:: path:: { Path , PathBuf } ;
35
37
@@ -105,6 +107,19 @@ bitflags::bitflags! {
105
107
}
106
108
}
107
109
110
+ #[ derive( Clone , Debug , Encodable , Decodable , HashStable ) ]
111
+ pub struct NativeLib {
112
+ pub kind : NativeLibKind ,
113
+ pub name : Option < Symbol > ,
114
+ pub cfg : Option < ast:: MetaItem > ,
115
+ }
116
+
117
+ impl From < & cstore:: NativeLib > for NativeLib {
118
+ fn from ( lib : & cstore:: NativeLib ) -> Self {
119
+ NativeLib { kind : lib. kind . clone ( ) , name : lib. name . clone ( ) , cfg : lib. cfg . clone ( ) }
120
+ }
121
+ }
122
+
108
123
/// Misc info we load from metadata to persist beyond the tcx.
109
124
///
110
125
/// Note: though `CrateNum` is only meaningful within the same tcx, information within `CrateInfo`
@@ -119,9 +134,9 @@ pub struct CrateInfo {
119
134
pub compiler_builtins : Option < CrateNum > ,
120
135
pub profiler_runtime : Option < CrateNum > ,
121
136
pub is_no_builtins : FxHashSet < CrateNum > ,
122
- pub native_libraries : FxHashMap < CrateNum , Lrc < Vec < NativeLib > > > ,
137
+ pub native_libraries : FxHashMap < CrateNum , Vec < NativeLib > > ,
123
138
pub crate_name : FxHashMap < CrateNum , String > ,
124
- pub used_libraries : Lrc < Vec < NativeLib > > ,
139
+ pub used_libraries : Vec < NativeLib > ,
125
140
pub link_args : Lrc < Vec < String > > ,
126
141
pub used_crate_source : FxHashMap < CrateNum , Lrc < CrateSource > > ,
127
142
pub used_crates_static : Vec < ( CrateNum , LibSource ) > ,
0 commit comments