@@ -7,7 +7,7 @@ use rustc::middle::cstore;
77use rustc:: session:: config:: { build_configuration, build_session_options, to_crate_config} ;
88use rustc:: session:: config:: { LtoCli , LinkerPluginLto , SwitchWithOptPath , ExternEntry } ;
99use 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 } ;
1111use rustc:: session:: { build_session, Session } ;
1212use rustc:: session:: search_paths:: SearchPath ;
1313use std:: collections:: { BTreeMap , BTreeSet } ;
@@ -38,14 +38,15 @@ fn mk_session(matches: getopts::Matches) -> (Session, CfgSpecs) {
3838fn new_public_extern_entry < S , I > ( locations : I ) -> ExternEntry
3939where
4040 S : Into < String > ,
41- I : IntoIterator < Item = Option < S > > ,
41+ I : IntoIterator < Item = S > ,
4242{
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 ( ) )
4444 . collect ( ) ;
4545
4646 ExternEntry {
47- locations,
48- is_private_dep : false
47+ location : ExternLocation :: ExactPaths ( locations) ,
48+ is_private_dep : false ,
49+ add_prelude : true ,
4950 }
5051}
5152
@@ -160,33 +161,33 @@ fn test_externs_tracking_hash_different_construction_order() {
160161 v1. externs = Externs :: new ( mk_map ( vec ! [
161162 (
162163 String :: from( "a" ) ,
163- new_public_extern_entry( vec![ Some ( "b" ) , Some ( "c" ) ] )
164+ new_public_extern_entry( vec![ "b" , "c" ] )
164165 ) ,
165166 (
166167 String :: from( "d" ) ,
167- new_public_extern_entry( vec![ Some ( "e" ) , Some ( "f" ) ] )
168+ new_public_extern_entry( vec![ "e" , "f" ] )
168169 ) ,
169170 ] ) ) ;
170171
171172 v2. externs = Externs :: new ( mk_map ( vec ! [
172173 (
173174 String :: from( "d" ) ,
174- new_public_extern_entry( vec![ Some ( "e" ) , Some ( "f" ) ] )
175+ new_public_extern_entry( vec![ "e" , "f" ] )
175176 ) ,
176177 (
177178 String :: from( "a" ) ,
178- new_public_extern_entry( vec![ Some ( "b" ) , Some ( "c" ) ] )
179+ new_public_extern_entry( vec![ "b" , "c" ] )
179180 ) ,
180181 ] ) ) ;
181182
182183 v3. externs = Externs :: new ( mk_map ( vec ! [
183184 (
184185 String :: from( "a" ) ,
185- new_public_extern_entry( vec![ Some ( "b" ) , Some ( "c" ) ] )
186+ new_public_extern_entry( vec![ "b" , "c" ] )
186187 ) ,
187188 (
188189 String :: from( "d" ) ,
189- new_public_extern_entry( vec![ Some ( "f" ) , Some ( "e" ) ] )
190+ new_public_extern_entry( vec![ "f" , "e" ] )
190191 ) ,
191192 ] ) ) ;
192193
0 commit comments