@@ -288,7 +288,7 @@ top_level_options!(
288
288
// much sense: The search path can stay the same while the
289
289
// things discovered there might have changed on disk.
290
290
search_paths: SearchPaths [ TRACKED ] ,
291
- libs: Vec <( String , Option <String >, cstore:: NativeLibraryKind ) > [ TRACKED ] ,
291
+ libs: Vec <( String , Option <String >, Option < cstore:: NativeLibraryKind > ) > [ TRACKED ] ,
292
292
maybe_sysroot: Option <PathBuf > [ TRACKED ] ,
293
293
294
294
target_triple: String [ TRACKED ] ,
@@ -1495,18 +1495,18 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
1495
1495
let mut parts = s. splitn ( 2 , '=' ) ;
1496
1496
let kind = parts. next ( ) . unwrap ( ) ;
1497
1497
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 ) ) ,
1503
1503
( _, s) => {
1504
1504
early_error ( error_format, & format ! ( "unknown library kind `{}`, expected \
1505
1505
one of dylib, framework, or static",
1506
1506
s) ) ;
1507
1507
}
1508
1508
} ;
1509
- if kind == cstore:: NativeStaticNobundle && !nightly_options:: is_nightly_build ( ) {
1509
+ if kind == Some ( cstore:: NativeStaticNobundle ) && !nightly_options:: is_nightly_build ( ) {
1510
1510
early_error ( error_format, & format ! ( "the library kind 'static-nobundle' is only \
1511
1511
accepted on the nightly compiler") ) ;
1512
1512
}
@@ -1772,6 +1772,7 @@ mod dep_tracking {
1772
1772
impl_dep_tracking_hash_via_hash ! ( Option <PanicStrategy >) ;
1773
1773
impl_dep_tracking_hash_via_hash ! ( Option <lint:: Level >) ;
1774
1774
impl_dep_tracking_hash_via_hash ! ( Option <PathBuf >) ;
1775
+ impl_dep_tracking_hash_via_hash ! ( Option <cstore:: NativeLibraryKind >) ;
1775
1776
impl_dep_tracking_hash_via_hash ! ( CrateType ) ;
1776
1777
impl_dep_tracking_hash_via_hash ! ( PanicStrategy ) ;
1777
1778
impl_dep_tracking_hash_via_hash ! ( Passes ) ;
@@ -1786,7 +1787,7 @@ mod dep_tracking {
1786
1787
impl_dep_tracking_hash_for_sortable_vec_of ! ( CrateType ) ;
1787
1788
impl_dep_tracking_hash_for_sortable_vec_of ! ( ( String , lint:: Level ) ) ;
1788
1789
impl_dep_tracking_hash_for_sortable_vec_of ! ( ( String , Option <String >,
1789
- cstore:: NativeLibraryKind ) ) ;
1790
+ Option < cstore:: NativeLibraryKind > ) ) ;
1790
1791
impl DepTrackingHash for SearchPaths {
1791
1792
fn hash ( & self , hasher : & mut DefaultHasher , _: ErrorOutputType ) {
1792
1793
let mut elems: Vec < _ > = self
@@ -2230,24 +2231,24 @@ mod tests {
2230
2231
let mut v4 = super :: basic_options ( ) ;
2231
2232
2232
2233
// Reference
2233
- v1. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2234
- ( String :: from( "b" ) , None , cstore:: NativeFramework ) ,
2235
- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2234
+ v1. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2235
+ ( String :: from( "b" ) , None , Some ( cstore:: NativeFramework ) ) ,
2236
+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
2236
2237
2237
2238
// Change label
2238
- v2. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2239
- ( String :: from( "X" ) , None , cstore:: NativeFramework ) ,
2240
- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2239
+ v2. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2240
+ ( String :: from( "X" ) , None , Some ( cstore:: NativeFramework ) ) ,
2241
+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
2241
2242
2242
2243
// Change kind
2243
- v3. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2244
- ( String :: from( "b" ) , None , cstore:: NativeStatic ) ,
2245
- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2244
+ v3. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2245
+ ( String :: from( "b" ) , None , Some ( cstore:: NativeStatic ) ) ,
2246
+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
2246
2247
2247
2248
// Change new-name
2248
- v4. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2249
- ( String :: from( "b" ) , Some ( String :: from( "X" ) ) , cstore:: NativeFramework ) ,
2250
- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2249
+ v4. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2250
+ ( String :: from( "b" ) , Some ( String :: from( "X" ) ) , Some ( cstore:: NativeFramework ) ) ,
2251
+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
2251
2252
2252
2253
assert ! ( v1. dep_tracking_hash( ) != v2. dep_tracking_hash( ) ) ;
2253
2254
assert ! ( v1. dep_tracking_hash( ) != v3. dep_tracking_hash( ) ) ;
@@ -2267,17 +2268,17 @@ mod tests {
2267
2268
let mut v3 = super :: basic_options ( ) ;
2268
2269
2269
2270
// Reference
2270
- v1. libs = vec ! [ ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2271
- ( String :: from( "b" ) , None , cstore:: NativeFramework ) ,
2272
- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2271
+ v1. libs = vec ! [ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2272
+ ( String :: from( "b" ) , None , Some ( cstore:: NativeFramework ) ) ,
2273
+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
2273
2274
2274
- v2. libs = vec ! [ ( String :: from( "b" ) , None , cstore:: NativeFramework ) ,
2275
- ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2276
- ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ] ;
2275
+ v2. libs = vec ! [ ( String :: from( "b" ) , None , Some ( cstore:: NativeFramework ) ) ,
2276
+ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2277
+ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ] ;
2277
2278
2278
- v3. libs = vec ! [ ( String :: from( "c" ) , None , cstore:: NativeUnknown ) ,
2279
- ( String :: from( "a" ) , None , cstore:: NativeStatic ) ,
2280
- ( String :: from( "b" ) , None , cstore:: NativeFramework ) ] ;
2279
+ v3. libs = vec ! [ ( String :: from( "c" ) , None , Some ( cstore:: NativeUnknown ) ) ,
2280
+ ( String :: from( "a" ) , None , Some ( cstore:: NativeStatic ) ) ,
2281
+ ( String :: from( "b" ) , None , Some ( cstore:: NativeFramework ) ) ] ;
2281
2282
2282
2283
assert ! ( v1. dep_tracking_hash( ) == v2. dep_tracking_hash( ) ) ;
2283
2284
assert ! ( v1. dep_tracking_hash( ) == v3. dep_tracking_hash( ) ) ;
0 commit comments