fn register_crate(&mut self,
root: &Option<CratePaths>,
ident: Symbol,
- name: Symbol,
span: Span,
lib: Library,
dep_kind: DepKind)
-> (CrateNum, Lrc<cstore::CrateMetadata>) {
- info!("register crate `extern crate {} as {}`", name, ident);
let crate_root = lib.metadata.get_root();
+ info!("register crate `extern crate {} as {}`", crate_root.name, ident);
self.verify_no_symbol_conflicts(span, &crate_root);
// Claim this crate number and cache it
.collect();
let cmeta = cstore::CrateMetadata {
- name,
+ name: crate_root.name,
extern_crate: Lock::new(None),
def_path_table: Lrc::new(def_path_table),
trait_impls,
(cnum, data)
}
LoadResult::Loaded(library) => {
- self.register_crate(root, ident, name, span, library, dep_kind)
+ self.register_crate(root, ident, span, library, dep_kind)
}
}
}
--- /dev/null
+-include ../tools.mk
+
+all:
+ $(RUSTC) foo.rs
+ $(RUSTC) bar.rs
+ $(RUSTC) baz.rs --extern a=$(TMPDIR)/libfoo.rlib
+
--- /dev/null
+// Copyright 2018 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type = "rlib"]
+
+extern crate foo;
--- /dev/null
+// Copyright 2018 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type = "rlib"]
+
+extern crate a;
+extern crate bar;
--- /dev/null
+// Copyright 2018 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type = "rlib"]