@@ -288,7 +288,7 @@ top_level_options!(
288288 // much sense: The search path can stay the same while the
289289 // things discovered there might have changed on disk.
290290 search_paths: SearchPaths [ TRACKED ] ,
291- libs: Vec <( String , Option <String >, cstore:: NativeLibraryKind ) > [ TRACKED ] ,
291+ libs: Vec <( String , Option <String >, Option < cstore:: NativeLibraryKind > ) > [ TRACKED ] ,
292292 maybe_sysroot: Option <PathBuf > [ TRACKED ] ,
293293
294294 target_triple: String [ TRACKED ] ,
@@ -1495,18 +1495,18 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
14951495 let mut parts = s. splitn ( 2 , '=' ) ;
14961496 let kind = parts. next ( ) . unwrap ( ) ;
14971497 let ( name, kind) = match ( parts. next ( ) , kind) {
1498- ( None , name) |
1499- ( Some ( name) , "dylib" ) => ( name, cstore:: NativeUnknown ) ,
1500- ( Some ( name) , "framework" ) => ( name, cstore:: NativeFramework ) ,
1501- ( Some ( name) , "static" ) => ( name, cstore:: NativeStatic ) ,
1502- ( Some ( name) , "static-nobundle" ) => ( name, cstore:: NativeStaticNobundle ) ,
1498+ ( None , name) => ( name , None ) ,
1499+ ( Some ( name) , "dylib" ) => ( name, Some ( cstore:: NativeUnknown ) ) ,
1500+ ( Some ( name) , "framework" ) => ( name, Some ( cstore:: NativeFramework ) ) ,
1501+ ( Some ( name) , "static" ) => ( name, Some ( cstore:: NativeStatic ) ) ,
1502+ ( Some ( name) , "static-nobundle" ) => ( name, Some ( cstore:: NativeStaticNobundle ) ) ,
15031503 ( _, s) => {
15041504 early_error ( error_format, & format ! ( "unknown library kind `{}`, expected \
15051505 one of dylib, framework, or static",
15061506 s) ) ;
15071507 }
15081508 } ;
1509- if kind == cstore:: NativeStaticNobundle && !nightly_options:: is_nightly_build ( ) {
1509+ if kind == Some ( cstore:: NativeStaticNobundle ) && !nightly_options:: is_nightly_build ( ) {
15101510 early_error ( error_format, & format ! ( "the library kind 'static-nobundle' is only \
15111511 accepted on the nightly compiler") ) ;
15121512 }
@@ -1772,6 +1772,7 @@ mod dep_tracking {
17721772 impl_dep_tracking_hash_via_hash ! ( Option <PanicStrategy >) ;
17731773 impl_dep_tracking_hash_via_hash ! ( Option <lint:: Level >) ;
17741774 impl_dep_tracking_hash_via_hash ! ( Option <PathBuf >) ;
1775+ impl_dep_tracking_hash_via_hash ! ( Option <cstore:: NativeLibraryKind >) ;
17751776 impl_dep_tracking_hash_via_hash ! ( CrateType ) ;
17761777 impl_dep_tracking_hash_via_hash ! ( PanicStrategy ) ;
17771778 impl_dep_tracking_hash_via_hash ! ( Passes ) ;
@@ -1788,7 +1789,7 @@ mod dep_tracking {
17881789 impl_dep_tracking_hash_for_sortable_vec_of ! ( CrateType ) ;
17891790 impl_dep_tracking_hash_for_sortable_vec_of ! ( ( String , lint:: Level ) ) ;
17901791 impl_dep_tracking_hash_for_sortable_vec_of ! ( ( String , Option <String >,
1791- cstore:: NativeLibraryKind ) ) ;
1792+ Option < cstore:: NativeLibraryKind > ) ) ;
17921793 impl DepTrackingHash for SearchPaths {
17931794 fn hash ( & self , hasher : & mut DefaultHasher , _: ErrorOutputType ) {
17941795 let mut elems: Vec < _ > = self
@@ -2232,24 +2233,24 @@ mod tests {
22322233 let mut v4 = super :: basic_options ( ) ;
22332234
22342235 // Reference
2235- v1. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2236- ( String :: from( "b" ) , None , cstore:: NativeFramework ) ,
2237- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2236+ v1. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2237+ ( String :: from( "b" ) , None , Some ( cstore:: NativeFramework ) ) ,
2238+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
22382239
22392240 // Change label
2240- v2. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2241- ( String :: from( "X" ) , None , cstore:: NativeFramework ) ,
2242- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2241+ v2. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2242+ ( String :: from( "X" ) , None , Some ( cstore:: NativeFramework ) ) ,
2243+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
22432244
22442245 // Change kind
2245- v3. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2246- ( String :: from( "b" ) , None , cstore:: NativeStatic ) ,
2247- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2246+ v3. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2247+ ( String :: from( "b" ) , None , Some ( cstore:: NativeStatic ) ) ,
2248+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
22482249
22492250 // Change new-name
2250- v4. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2251- ( String :: from( "b" ) , Some ( String :: from( "X" ) ) , cstore:: NativeFramework ) ,
2252- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2251+ v4. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2252+ ( String :: from( "b" ) , Some ( String :: from( "X" ) ) , Some ( cstore:: NativeFramework ) ) ,
2253+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
22532254
22542255 assert ! ( v1. dep_tracking_hash( ) != v2. dep_tracking_hash( ) ) ;
22552256 assert ! ( v1. dep_tracking_hash( ) != v3. dep_tracking_hash( ) ) ;
@@ -2269,17 +2270,17 @@ mod tests {
22692270 let mut v3 = super :: basic_options ( ) ;
22702271
22712272 // Reference
2272- v1. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2273- ( String :: from( "b" ) , None , cstore:: NativeFramework ) ,
2274- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2273+ v1. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2274+ ( String :: from( "b" ) , None , Some ( cstore:: NativeFramework ) ) ,
2275+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
22752276
2276- v2. libs = vec ! [ ( String :: from( "b" ) , None , cstore:: NativeFramework ) ,
2277- ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2278- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2277+ v2. libs = vec ! [ ( String :: from( "b" ) , None , Some ( cstore:: NativeFramework ) ) ,
2278+ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2279+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
22792280
2280- v3. libs = vec ! [ ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ,
2281- ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2282- ( String :: from( "b" ) , None , cstore:: NativeFramework ) ] ;
2281+ v3. libs = vec ! [ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ,
2282+ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2283+ ( String :: from( "b" ) , None , Some ( cstore:: NativeFramework ) ) ] ;
22832284
22842285 assert ! ( v1. dep_tracking_hash( ) == v2. dep_tracking_hash( ) ) ;
22852286 assert ! ( v1. dep_tracking_hash( ) == v3. dep_tracking_hash( ) ) ;
0 commit comments