@@ -7,7 +7,7 @@ use rustc::middle::cstore;
7
7
use rustc:: session:: config:: { build_configuration, build_session_options, to_crate_config} ;
8
8
use rustc:: session:: config:: { LtoCli , LinkerPluginLto , SwitchWithOptPath , ExternEntry } ;
9
9
use rustc:: session:: config:: { Externs , OutputType , OutputTypes , SymbolManglingVersion } ;
10
- use rustc:: session:: config:: { rustc_optgroups, Options , ErrorOutputType , Passes } ;
10
+ use rustc:: session:: config:: { rustc_optgroups, Options , ErrorOutputType , Passes , ExternLocation } ;
11
11
use rustc:: session:: { build_session, Session } ;
12
12
use rustc:: session:: search_paths:: SearchPath ;
13
13
use std:: collections:: { BTreeMap , BTreeSet } ;
@@ -38,14 +38,15 @@ fn mk_session(matches: getopts::Matches) -> (Session, CfgSpecs) {
38
38
fn new_public_extern_entry < S , I > ( locations : I ) -> ExternEntry
39
39
where
40
40
S : Into < String > ,
41
- I : IntoIterator < Item = Option < S > > ,
41
+ I : IntoIterator < Item = S > ,
42
42
{
43
- let locations: BTreeSet < _ > = locations. into_iter ( ) . map ( |o| o . map ( | s| s. into ( ) ) )
43
+ let locations: BTreeSet < _ > = locations. into_iter ( ) . map ( |s| s. into ( ) )
44
44
. collect ( ) ;
45
45
46
46
ExternEntry {
47
- locations,
48
- is_private_dep : false
47
+ location : ExternLocation :: ExactPaths ( locations) ,
48
+ is_private_dep : false ,
49
+ add_prelude : true ,
49
50
}
50
51
}
51
52
@@ -160,33 +161,33 @@ fn test_externs_tracking_hash_different_construction_order() {
160
161
v1. externs = Externs :: new ( mk_map ( vec ! [
161
162
(
162
163
String :: from( "a" ) ,
163
- new_public_extern_entry( vec![ Some ( "b" ) , Some ( "c" ) ] )
164
+ new_public_extern_entry( vec![ "b" , "c" ] )
164
165
) ,
165
166
(
166
167
String :: from( "d" ) ,
167
- new_public_extern_entry( vec![ Some ( "e" ) , Some ( "f" ) ] )
168
+ new_public_extern_entry( vec![ "e" , "f" ] )
168
169
) ,
169
170
] ) ) ;
170
171
171
172
v2. externs = Externs :: new ( mk_map ( vec ! [
172
173
(
173
174
String :: from( "d" ) ,
174
- new_public_extern_entry( vec![ Some ( "e" ) , Some ( "f" ) ] )
175
+ new_public_extern_entry( vec![ "e" , "f" ] )
175
176
) ,
176
177
(
177
178
String :: from( "a" ) ,
178
- new_public_extern_entry( vec![ Some ( "b" ) , Some ( "c" ) ] )
179
+ new_public_extern_entry( vec![ "b" , "c" ] )
179
180
) ,
180
181
] ) ) ;
181
182
182
183
v3. externs = Externs :: new ( mk_map ( vec ! [
183
184
(
184
185
String :: from( "a" ) ,
185
- new_public_extern_entry( vec![ Some ( "b" ) , Some ( "c" ) ] )
186
+ new_public_extern_entry( vec![ "b" , "c" ] )
186
187
) ,
187
188
(
188
189
String :: from( "d" ) ,
189
- new_public_extern_entry( vec![ Some ( "f" ) , Some ( "e" ) ] )
190
+ new_public_extern_entry( vec![ "f" , "e" ] )
190
191
) ,
191
192
] ) ) ;
192
193
0 commit comments