Skip to content

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

Open
@petrochenkov

Description

@petrochenkov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-metadataArea: Crate metadataC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions