File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
trunk/src/librustc/metadata Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 5367c32c7ddb873babec89f739a936409d45476a
2
+ refs/heads/master: cced02fcacfe4a6d1598e987003e00aa65713efb
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: e263ef1df7b892ed29e53313565eb05ab75e52f4
5
5
refs/heads/try: 597a645456b55e1c886ce15d23a192abdf4d55cf
Original file line number Diff line number Diff line change @@ -317,15 +317,23 @@ impl<'a> Context<'a> {
317
317
// read the metadata from it if `*slot` is `None`. If the metadata couldn't
318
318
// be read, it is assumed that the file isn't a valid rust library (no
319
319
// errors are emitted).
320
- //
321
- // FIXME(#10786): for an optimization, we only read one of the library's
322
- // metadata sections. In theory we should read both, but
323
- // reading dylib metadata is quite slow.
324
320
fn extract_one ( & mut self , m : HashSet < Path > , flavor : & str ,
325
321
slot : & mut Option < MetadataBlob > ) -> Option < Path > {
326
322
let mut ret = None :: < Path > ;
327
323
let mut error = 0 ;
328
324
325
+ if slot. is_some ( ) {
326
+ // FIXME(#10786): for an optimization, we only read one of the
327
+ // library's metadata sections. In theory we should
328
+ // read both, but reading dylib metadata is quite
329
+ // slow.
330
+ if m. len ( ) == 0 {
331
+ return None
332
+ } else if m. len ( ) == 1 {
333
+ return Some ( m. move_iter ( ) . next ( ) . unwrap ( ) )
334
+ }
335
+ }
336
+
329
337
for lib in m. move_iter ( ) {
330
338
info ! ( "{} reading metadata from: {}" , flavor, lib. display( ) ) ;
331
339
let metadata = match get_metadata_section ( self . os , & lib) {
You can’t perform that action at this time.
0 commit comments