Expand description
Special visiting used by rust-analyzer only.
It is different from TypeVisitable in two ways:
- The visitor is a generic of the trait and not the method, allowing types to attach special behavior to visitors (as long as they know it; we don’t use this capability in rustc crates, but rust-analyzer needs it).
- It must visit every field. This is why we don’t have an attribute like
#[type_visitable(ignore)]for this visit. The reason for this is soundness: rust-analyzer uses this visit to garbage collect types, so a missing field can mean a use after free
Macros§
Traits§
- Generic
Type Visitable - This trait is implemented for every type that can be visited, providing the skeleton of the traversal.