mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-02 19:06:05 +00:00
Use real crate name in crate_map name
`use` statement may introduce an crate name alias. This patch always uses the link attrbute "name" as the crate's name when building the crate map. Closes #1706
This commit is contained in:
parent
139420f664
commit
13686b6778
@ -355,7 +355,11 @@ fn resolve_crate(e: env, ident: ast::ident, metas: [@ast::meta_item],
|
||||
// Now resolve the crates referenced by this crate
|
||||
let cnum_map = resolve_crate_deps(e, cdata);
|
||||
|
||||
let cmeta = @{name: ident, data: cdata,
|
||||
let cname = alt attr::meta_item_value_from_list(metas, "name") {
|
||||
option::some(v) { v }
|
||||
option::none { ident }
|
||||
};
|
||||
let cmeta = @{name: cname, data: cdata,
|
||||
cnum_map: cnum_map, cnum: cnum};
|
||||
|
||||
let cstore = e.sess.cstore;
|
||||
|
4
src/test/run-pass/use-crate-name-alias.rs
Normal file
4
src/test/run-pass/use-crate-name-alias.rs
Normal file
@ -0,0 +1,4 @@
|
||||
// Issue #1706
|
||||
use stdlib(name="std");
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user