-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Avoid loading needless proc-macro dependencies #38024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid loading needless proc-macro dependencies #38024
Conversation
cc @nrc |
83f9ab2
to
08ef9ff
Compare
Could this be reviewed and prioritised? This is blocking rustup in Servo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r = me with the comment expanded.
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these only used by monomorphised functions or is there some reason to include them. Would be good to comment in any case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
08ef9ff
to
1fd9041
Compare
@bors r=nrc |
📌 Commit 1fd9041 has been approved by |
@bors p=1 |
Avoid loading needless proc-macro dependencies 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
⛄ The build was interrupted to prioritize another pull request. |
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