-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
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.