about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_metadata/creader.rs3
-rw-r--r--src/test/run-make/issue-37893/Makefile4
-rw-r--r--src/test/run-make/issue-37893/a.rs13
-rw-r--r--src/test/run-make/issue-37893/b.rs12
-rw-r--r--src/test/run-make/issue-37893/c.rs13
5 files changed, 45 insertions, 0 deletions
diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs
index 5384535024e..56def16ea45 100644
--- a/src/librustc_metadata/creader.rs
+++ b/src/librustc_metadata/creader.rs
@@ -366,6 +366,9 @@ impl<'a> CrateLoader<'a> {
         match result {
             LoadResult::Previous(cnum) => {
                 let data = self.cstore.get_crate_data(cnum);
+                if data.root.macro_derive_registrar.is_some() {
+                    dep_kind = DepKind::MacrosOnly;
+                }
                 data.dep_kind.set(cmp::max(data.dep_kind.get(), dep_kind));
                 (cnum, data)
             }
diff --git a/src/test/run-make/issue-37893/Makefile b/src/test/run-make/issue-37893/Makefile
new file mode 100644
index 00000000000..27b69baf977
--- /dev/null
+++ b/src/test/run-make/issue-37893/Makefile
@@ -0,0 +1,4 @@
+-include ../tools.mk
+
+all:
+	$(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs
diff --git a/src/test/run-make/issue-37893/a.rs b/src/test/run-make/issue-37893/a.rs
new file mode 100644
index 00000000000..3dff45388c7
--- /dev/null
+++ b/src/test/run-make/issue-37893/a.rs
@@ -0,0 +1,13 @@
+// Copyright 2016 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.
+
+#![feature(proc_macro)]
+#![allow(unused)]
+#![crate_type = "proc-macro"]
diff --git a/src/test/run-make/issue-37893/b.rs b/src/test/run-make/issue-37893/b.rs
new file mode 100644
index 00000000000..82f48f6d8d6
--- /dev/null
+++ b/src/test/run-make/issue-37893/b.rs
@@ -0,0 +1,12 @@
+// Copyright 2016 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 = "lib"]
+#[macro_use] extern crate a;
diff --git a/src/test/run-make/issue-37893/c.rs b/src/test/run-make/issue-37893/c.rs
new file mode 100644
index 00000000000..eee55cc2369
--- /dev/null
+++ b/src/test/run-make/issue-37893/c.rs
@@ -0,0 +1,13 @@
+// Copyright 2016 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 = "staticlib"]
+extern crate b;
+extern crate a;