@@ -180,11 +180,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
180
180
. env_remove ( "RUST_LOG" ) ;
181
181
182
182
for crate_type in crate_types {
183
- // Here and below we'll skip the metadata crate-type because it is
184
- // not supported by older compilers. We'll do this one manually.
185
- if crate_type != "metadata" {
186
- process. arg ( "--crate-type" ) . arg ( crate_type) ;
187
- }
183
+ process. arg ( "--crate-type" ) . arg ( crate_type) ;
188
184
}
189
185
if kind == Kind :: Target {
190
186
process. arg ( "--target" ) . arg ( & self . target_triple ( ) ) ;
@@ -235,12 +231,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
235
231
map. insert ( crate_type. to_string ( ) , Some ( ( prefix. to_string ( ) , suffix. to_string ( ) ) ) ) ;
236
232
}
237
233
238
- // Manually handle the metadata case. If it is not supported by the
239
- // compiler we'll error out elsewhere.
240
- if crate_types. contains ( "metadata" ) {
241
- map. insert ( "metadata" . to_string ( ) , Some ( ( "lib" . to_owned ( ) , ".rmeta" . to_owned ( ) ) ) ) ;
242
- }
243
-
244
234
let cfg = if has_cfg {
245
235
Some ( try!( lines. map ( Cfg :: from_str) . collect ( ) ) )
246
236
} else {
@@ -502,32 +492,36 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
502
492
let mut ret = Vec :: new ( ) ;
503
493
let mut unsupported = Vec :: new ( ) ;
504
494
{
505
- let mut add = |crate_type : & str , linkable : bool | -> CargoResult < ( ) > {
506
- let crate_type = if crate_type == "lib" { "rlib" } else { crate_type} ;
507
- match info. crate_types . get ( crate_type) {
508
- Some ( & Some ( ( ref prefix, ref suffix) ) ) => {
509
- let filename = out_dir. join ( format ! ( "{}{}{}" , prefix, stem, suffix) ) ;
510
- let link_dst = link_stem. clone ( ) . map ( |( ld, ls) | {
511
- ld. join ( format ! ( "{}{}{}" , prefix, ls, suffix) )
512
- } ) ;
513
- ret. push ( ( filename, link_dst, linkable) ) ;
514
- Ok ( ( ) )
515
- }
516
- // not supported, don't worry about it
517
- Some ( & None ) => {
518
- unsupported. push ( crate_type. to_string ( ) ) ;
519
- Ok ( ( ) )
520
- }
521
- None => {
522
- bail ! ( "failed to learn about crate-type `{}` early on" ,
523
- crate_type)
524
- }
525
- }
526
- } ;
527
-
528
495
if unit. profile . check {
529
- add ( "metadata" , true ) ?;
496
+ let filename = out_dir. join ( format ! ( "lib{}.rmeta" , stem) ) ;
497
+ let link_dst = link_stem. clone ( ) . map ( |( ld, ls) | {
498
+ ld. join ( format ! ( "lib{}.rmeta" , ls) )
499
+ } ) ;
500
+ ret. push ( ( filename, link_dst, true ) ) ;
530
501
} else {
502
+ let mut add = |crate_type : & str , linkable : bool | -> CargoResult < ( ) > {
503
+ let crate_type = if crate_type == "lib" { "rlib" } else { crate_type} ;
504
+ match info. crate_types . get ( crate_type) {
505
+ Some ( & Some ( ( ref prefix, ref suffix) ) ) => {
506
+ let filename = out_dir. join ( format ! ( "{}{}{}" , prefix, stem, suffix) ) ;
507
+ let link_dst = link_stem. clone ( ) . map ( |( ld, ls) | {
508
+ ld. join ( format ! ( "{}{}{}" , prefix, ls, suffix) )
509
+ } ) ;
510
+ ret. push ( ( filename, link_dst, linkable) ) ;
511
+ Ok ( ( ) )
512
+ }
513
+ // not supported, don't worry about it
514
+ Some ( & None ) => {
515
+ unsupported. push ( crate_type. to_string ( ) ) ;
516
+ Ok ( ( ) )
517
+ }
518
+ None => {
519
+ bail ! ( "failed to learn about crate-type `{}` early on" ,
520
+ crate_type)
521
+ }
522
+ }
523
+ } ;
524
+
531
525
match * unit. target . kind ( ) {
532
526
TargetKind :: Example |
533
527
TargetKind :: Bin |
0 commit comments