]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #17189 : bkoropoff/rust/extern-existing-crate, r=alexcrichton
authorbors <bors@rust-lang.org>
Sun, 14 Sep 2014 00:51:05 +0000 (00:51 +0000)
committerbors <bors@rust-lang.org>
Sun, 14 Sep 2014 00:51:05 +0000 (00:51 +0000)
When checking for an existing crate, compare against the `crate_metadata::name` field, which is the crate name which was requested during resolution, rather than the result of the `crate_metadata::name()` method, which is the crate name within the crate metadata, as these may not match when using the --extern option to `rustc`.

This fixes spurious "multiple crate version" warnings under the following scenario:

- The crate `foo`, is referenced multiple times
- `--extern foo=./path/to/libbar.rlib` is specified to rustc
- The internal crate name of `libbar.rlib` is not `foo`

The behavior surrounding `Context::should_match_name` and the comments in `loader.rs` both lead me to believe that this scenario is intended to work.

Fixes #17186

1  2 
src/librustc/metadata/creader.rs

Simple merge