diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 8c17c16afee..b82c9c93376 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -145,7 +145,7 @@ fn extract_crate_info(e: &Env, i: &ast::ViewItem) -> Option { match i.node { ast::ViewItemExternCrate(ident, ref path_opt, id) => { let ident = token::get_ident(ident); - debug!("resolving extern crate stmt. ident: {:?} path_opt: {:?}", + debug!("resolving extern crate stmt. ident: {} path_opt: {}", ident, path_opt); let name = match *path_opt { Some((ref path_str, _)) => { @@ -281,7 +281,7 @@ fn existing_match(e: &Env, name: &str, hash: Option<&Svh>) -> Option { let mut ret = None; e.sess.cstore.iter_crate_data(|cnum, data| { - if data.name().as_slice() != name { return } + if data.name.as_slice() != name { return } match hash { Some(hash) if *hash == data.hash() => { ret = Some(cnum); return } diff --git a/src/test/run-make/extern-diff-internal-name/Makefile b/src/test/run-make/extern-diff-internal-name/Makefile new file mode 100644 index 00000000000..3787b879c1f --- /dev/null +++ b/src/test/run-make/extern-diff-internal-name/Makefile @@ -0,0 +1,6 @@ +-include ../tools.mk + +all: + $(RUSTC) lib.rs + $(RUSTC) test.rs --extern foo=$(TMPDIR)/libbar.rlib 2>&1 | \ + { ! grep "using multiple versions of crate"; } diff --git a/src/test/run-make/extern-diff-internal-name/lib.rs b/src/test/run-make/extern-diff-internal-name/lib.rs new file mode 100644 index 00000000000..e8779bba13c --- /dev/null +++ b/src/test/run-make/extern-diff-internal-name/lib.rs @@ -0,0 +1,12 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_name = "bar"] +#![crate_type = "rlib"] diff --git a/src/test/run-make/extern-diff-internal-name/test.rs b/src/test/run-make/extern-diff-internal-name/test.rs new file mode 100644 index 00000000000..ab1cf96999d --- /dev/null +++ b/src/test/run-make/extern-diff-internal-name/test.rs @@ -0,0 +1,17 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(phase)] + +#[phase(plugin, link)] +extern crate foo; + +fn main() { +}