Skip to content

Sort out body-less function argument names wrt incremental recompilation. #38501

Closed
@eddyb

Description

@eddyb

The x and y in trait Foo { fn bar(x: T, y: U); }, for example, are stored outside of any isolation, as such function declarations don't have bodies holding the arguments (see #38449), for this purpose.

Right now they're primarily used by rustdoc, which even loads them across crates. #38449 asserts that the cross-crate usage always happens without incremental recompilation and doesn't track the MetaData edge for them in neither the original crate or the one observing these "argument names".

OTOH, the same-crate usage is virtually impossible to prevent, accidentally, which leads to the implementation in #38449 hashing "argument names" as part of the definition's signature, for now.

Also, ideally, tools like rustdoc would have their own infrastructure (which save-analysis aims to be), potentially quite different (divergent even?) from rustc's HIR, but that will take some effort to reach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-cleanupCategory: PRs that clean code up or issues documenting cleanup.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