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

Remember names of cfg-ed out items to mention them in diagnostics #109005

Merged
merged 1 commit into from
Jun 7, 2023

Commits on Jun 1, 2023

  1. Remember names of cfg-ed out items to mention them in diagnostics

    `#[cfg]`s are frequently used to gate crate content behind cargo
    features. This can lead to very confusing errors when features are
    missing. For example, `serde` doesn't have the `derive` feature by
    default. Therefore, `serde::Serialize` fails to resolve with a generic
    error, even though the macro is present in the docs.
    
    This commit adds a list of all stripped item names to metadata. This is
    filled during macro expansion and then, through a fed query, persisted
    in metadata. The downstream resolver can then access the metadata to
    look at possible candidates for mentioning in the errors.
    
    This slightly increases metadata (800k->809k for the feature-heavy
    windows crate), but not enough to really matter.
    Noratrieb committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    a647ba2 View commit details
    Browse the repository at this point in the history