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

Encode less metadata for proc-macro crates #76897

Merged
merged 1 commit into from
Sep 26, 2020

Commits on Sep 26, 2020

  1. Encode less metadata for proc-macro crates

    Currently, we serialize the same crate metadata for proc-macro crates as
    we do for normal crates. This is quite wasteful - almost none of this
    metadata is ever used, and much of it can't even be deserialized (if it
    contains a foreign `CrateNum`).
    
    This PR changes metadata encoding to skip encoding the majority of crate
    metadata for proc-macro crates. Most of the `Lazy<[T]>` fields are left
    completetly empty, while the non-lazy fields are left as-is.
    
    Additionally, proc-macros now have a def span that does not include
    their body. This was done for normal functions in rust-lang#75465, but was missed
    for proc-macros.
    
    As a result of this PR, we should only ever encode local `CrateNum`s
    when encoding proc-macro crates. I've added a specialized serialization
    impl for `CrateNum` to assert this.
    Aaron1011 committed Sep 26, 2020
    Configuration menu
    Copy the full SHA
    b965356 View commit details
    Browse the repository at this point in the history