@@ -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 ) ;
@@ -1788,7 +1789,7 @@ mod dep_tracking {
1788
1789
impl_dep_tracking_hash_for_sortable_vec_of ! ( CrateType ) ;
1789
1790
impl_dep_tracking_hash_for_sortable_vec_of ! ( ( String , lint:: Level ) ) ;
1790
1791
impl_dep_tracking_hash_for_sortable_vec_of ! ( ( String , Option <String >,
1791
- cstore:: NativeLibraryKind ) ) ;
1792
+ Option < cstore:: NativeLibraryKind > ) ) ;
1792
1793
impl DepTrackingHash for SearchPaths {
1793
1794
fn hash ( & self , hasher : & mut DefaultHasher , _: ErrorOutputType ) {
1794
1795
let mut elems: Vec < _ > = self
@@ -2232,24 +2233,24 @@ mod tests {
2232
2233
let mut v4 = super :: basic_options ( ) ;
2233
2234
2234
2235
// 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 ) ) ] ;
2238
2239
2239
2240
// 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 ) ) ] ;
2243
2244
2244
2245
// 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 ) ) ] ;
2248
2249
2249
2250
// 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 ) ) ] ;
2253
2254
2254
2255
assert ! ( v1. dep_tracking_hash( ) != v2. dep_tracking_hash( ) ) ;
2255
2256
assert ! ( v1. dep_tracking_hash( ) != v3. dep_tracking_hash( ) ) ;
@@ -2269,17 +2270,17 @@ mod tests {
2269
2270
let mut v3 = super :: basic_options ( ) ;
2270
2271
2271
2272
// 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 ) ) ] ;
2275
2276
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 ) ) ] ;
2279
2280
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 ) ) ] ;
2283
2284
2284
2285
assert ! ( v1. dep_tracking_hash( ) == v2. dep_tracking_hash( ) ) ;
2285
2286
assert ! ( v1. dep_tracking_hash( ) == v3. dep_tracking_hash( ) ) ;
0 commit comments