Skip to content
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

metadata: Span data and SourceFiles for macro-only dependencies can be inlined #74731

Open
petrochenkov opened this issue Jul 25, 2020 · 0 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-metadata Area: Crate metadata C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

petrochenkov commented Jul 25, 2020

Some crates are only used for their macros (which are only expanded, but not reexported), but are still required to be loaded (for their spans) when loading non-macro library crates that were produced using those macros.
(It doesn't matter whether the macros are declarative or procedural.)

#73706 implemented a way to inline span data from such macro crates into library crates.

As a result #69432 can be reverted now and span data from macro-only dependencies can be inlined on as-needed basis.

The usual downside is that the same data can be inlined into multiple libraries and duplicated, instead of existing as a separate crate that is shared, however #73706 showed that such inlining is a cumulative improvement and can also be useful for other purposes (#73047).

cc @Aaron1011

@jonas-schievink jonas-schievink added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-metadata Area: Crate metadata C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-metadata Area: Crate metadata C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants