diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 5384535024e53..56def16ea45fd 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 0000000000000..27b69baf97787 --- /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 0000000000000..3dff45388c75b --- /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 or the MIT license +// , 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 0000000000000..82f48f6d8d667 --- /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 or the MIT license +// , 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 0000000000000..eee55cc236966 --- /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 or the MIT license +// , 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;