diff options
| author | bors <bors@rust-lang.org> | 2016-11-21 00:16:51 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-21 00:16:51 -0600 |
| commit | b8f6c20657dba5db43668cdc44c86d0547f7e31f (patch) | |
| tree | a493d90fd89e02321cbec800ef6c518e2f00f50a /src | |
| parent | fc2373c5a24646745dcbc14dc58889a9d8843f4e (diff) | |
| parent | 7d0c76aced18b3491bda4eeda9c570ad79d8416f (diff) | |
| download | rust-b8f6c20657dba5db43668cdc44c86d0547f7e31f.tar.gz rust-b8f6c20657dba5db43668cdc44c86d0547f7e31f.zip | |
Auto merge of #37895 - jseyfried:fix_proc_macro_deps, r=nrc
Fix bug involving proc-macro dependencies Fixes #37893. r? @nrc
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_metadata/creader.rs | 3 | ||||
| -rw-r--r-- | src/test/run-make/issue-37893/Makefile | 4 | ||||
| -rw-r--r-- | src/test/run-make/issue-37893/a.rs | 13 | ||||
| -rw-r--r-- | src/test/run-make/issue-37893/b.rs | 12 | ||||
| -rw-r--r-- | src/test/run-make/issue-37893/c.rs | 13 |
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; |
