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:
Haitao Li 2012-04-06 18:43:14 +08:00
parent 139420f664
commit 13686b6778
2 changed files with 9 additions and 1 deletions

View File

@ -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;

View File

@ -0,0 +1,4 @@
// Issue #1706
use stdlib(name="std");
fn main() {}