dylib, rlib, metadata
} = load_ctxt.load_library_crate(root);
- // Claim this crate number and cache it
- let cnum = e.next_crate_num;
- e.next_crate_num += 1;
-
// Stash paths for top-most crate locally if necessary.
let crate_paths = if root.is_none() {
Some(CratePaths {
@RefCell::new(HashMap::new())
};
+ // Claim this crate number and cache it if we're linking to the
+ // crate, otherwise it's a syntax-only crate and we don't need to
+ // reserve a number
+ let cnum = if should_link {
+ let n = e.next_crate_num;
+ e.next_crate_num += 1;
+ n
+ } else {
+ -1
+ };
+
let cmeta = @cstore::crate_metadata {
name: load_ctxt.crate_id.name.to_owned(),
data: metadata,
--- /dev/null
+// 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 <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.
+
+// no-prefer-dynamic
+
+#![crate_type = "dylib"]
--- /dev/null
+// 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 <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.
+
+// no-prefer-dynamic
+
+#![crate_type = "rlib"]
--- /dev/null
+// 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 <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.
+
+// no-prefer-dynamic
+
+#![crate_type = "rlib"]
+#![feature(phase)]
+
+#[phase(syntax)] extern crate t1 = "issue-13560-1";
+#[phase(syntax, link)] extern crate t2 = "issue-13560-2";
+
--- /dev/null
+// 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 <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.
+
+// aux-build:issue-13560-1.rs
+// aux-build:issue-13560-2.rs
+// aux-build:issue-13560-3.rs
+// ignore-stage1
+// ignore-android
+// ignore-cross-compile #12102
+
+// Regression test for issue #13560, the test itself is all in the dependent
+// libraries. The fail which previously failed to compile is the one numbered 3.
+
+extern crate t2 = "issue-13560-2";
+extern crate t3 = "issue-13560-3";
+
+fn main() {}