@@ -146,9 +146,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
146
146
unit : & Unit < ' a > ,
147
147
crate_types : & mut BTreeSet < String > )
148
148
-> CargoResult < ( ) > {
149
- if unit. profile . check {
150
- crate_types. insert ( "metadata" . to_string ( ) ) ;
151
- }
152
149
for target in unit. pkg . manifest ( ) . targets ( ) {
153
150
crate_types. extend ( target. rustc_crate_types ( ) . iter ( ) . map ( |s| {
154
151
if * s == "lib" {
@@ -180,11 +177,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
180
177
. env_remove ( "RUST_LOG" ) ;
181
178
182
179
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
- }
180
+ process. arg ( "--crate-type" ) . arg ( crate_type) ;
188
181
}
189
182
if kind == Kind :: Target {
190
183
process. arg ( "--target" ) . arg ( & self . target_triple ( ) ) ;
@@ -216,9 +209,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
216
209
map. insert ( crate_type. to_string ( ) , None ) ;
217
210
continue ;
218
211
}
219
- if crate_type == "metadata" {
220
- continue ;
221
- }
222
212
let line = match lines. next ( ) {
223
213
Some ( line) => line,
224
214
None => bail ! ( "malformed output when learning about \
@@ -235,12 +225,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
235
225
map. insert ( crate_type. to_string ( ) , Some ( ( prefix. to_string ( ) , suffix. to_string ( ) ) ) ) ;
236
226
}
237
227
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
228
let cfg = if has_cfg {
245
229
Some ( try!( lines. map ( Cfg :: from_str) . collect ( ) ) )
246
230
} else {
@@ -502,32 +486,36 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
502
486
let mut ret = Vec :: new ( ) ;
503
487
let mut unsupported = Vec :: new ( ) ;
504
488
{
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
489
if unit. profile . check {
529
- add ( "metadata" , true ) ?;
490
+ let filename = out_dir. join ( format ! ( "lib{}.rmeta" , stem) ) ;
491
+ let link_dst = link_stem. clone ( ) . map ( |( ld, ls) | {
492
+ ld. join ( format ! ( "lib{}.rmeta" , ls) )
493
+ } ) ;
494
+ ret. push ( ( filename, link_dst, true ) ) ;
530
495
} else {
496
+ let mut add = |crate_type : & str , linkable : bool | -> CargoResult < ( ) > {
497
+ let crate_type = if crate_type == "lib" { "rlib" } else { crate_type} ;
498
+ match info. crate_types . get ( crate_type) {
499
+ Some ( & Some ( ( ref prefix, ref suffix) ) ) => {
500
+ let filename = out_dir. join ( format ! ( "{}{}{}" , prefix, stem, suffix) ) ;
501
+ let link_dst = link_stem. clone ( ) . map ( |( ld, ls) | {
502
+ ld. join ( format ! ( "{}{}{}" , prefix, ls, suffix) )
503
+ } ) ;
504
+ ret. push ( ( filename, link_dst, linkable) ) ;
505
+ Ok ( ( ) )
506
+ }
507
+ // not supported, don't worry about it
508
+ Some ( & None ) => {
509
+ unsupported. push ( crate_type. to_string ( ) ) ;
510
+ Ok ( ( ) )
511
+ }
512
+ None => {
513
+ bail ! ( "failed to learn about crate-type `{}` early on" ,
514
+ crate_type)
515
+ }
516
+ }
517
+ } ;
518
+
531
519
match * unit. target . kind ( ) {
532
520
TargetKind :: Example |
533
521
TargetKind :: Bin |
0 commit comments