Auto merge of #37895 - jseyfried:fix_proc_macro_deps, r=nrc
Fix bug involving proc-macro dependencies Fixes #37893. r? @nrc
This commit is contained in:
@@ -366,6 +366,9 @@ impl<'a> CrateLoader<'a> {
|
|||||||
match result {
|
match result {
|
||||||
LoadResult::Previous(cnum) => {
|
LoadResult::Previous(cnum) => {
|
||||||
let data = self.cstore.get_crate_data(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));
|
data.dep_kind.set(cmp::max(data.dep_kind.get(), dep_kind));
|
||||||
(cnum, data)
|
(cnum, data)
|
||||||
}
|
}
|
||||||
|
|||||||
4
src/test/run-make/issue-37893/Makefile
Normal file
4
src/test/run-make/issue-37893/Makefile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-include ../tools.mk
|
||||||
|
|
||||||
|
all:
|
||||||
|
$(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs
|
||||||
13
src/test/run-make/issue-37893/a.rs
Normal file
13
src/test/run-make/issue-37893/a.rs
Normal file
@@ -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"]
|
||||||
12
src/test/run-make/issue-37893/b.rs
Normal file
12
src/test/run-make/issue-37893/b.rs
Normal file
@@ -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;
|
||||||
13
src/test/run-make/issue-37893/c.rs
Normal file
13
src/test/run-make/issue-37893/c.rs
Normal file
@@ -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;
|
||||||
Reference in New Issue
Block a user