Avoid loading needless proc-macro dependencies #38024
+48
−27
|
cc @nrc |
| @@ -67,6 +67,8 @@ pub struct CrateSource { | ||
| #[derive(RustcEncodable, RustcDecodable, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Debug)] | ||
| pub enum DepKind { | ||
| + /// A dependency that is only used for its macros, none of which are visible from other crates. | ||
| + UnexportedMacrosOnly, |
nrc
Nov 28, 2016
Contributor
Are these only used by monomorphised functions or is there some reason to include them. Would be good to comment in any case.
jseyfried
Nov 28, 2016
Contributor
UnexportedMacrosOnly are only included in the metadata as placeholders (the CrateNum of a dependency is computed from its position in the dependency list) -- I'll add a comment.
Does that answer your question? (not sure how monomorphised functions are relevant)
jseyfried
Nov 28, 2016
•
Contributor
Oh, I see -- monomorphised functions from extern crates might need to access non-visible functions. I don't think this is relevant to macros though, since expansion finishes before monomorphization.
|
@bors r=nrc |
|
|
|
@bors p=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixes #37958 when no proc-macros are exported; in particular, without
pub extern crate proc_macros;,#![feature(macro_reexport)], or#![feature(use_extern_macros)].I opened rust-lang/cargo#3334 for exported proc macros.
r? @alexcrichton