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
Re-exportsΒ§
use std::sync::Arc;πuse rustc_index::Idx;πuse rustc_index::IndexVec;πuse smallvec::SmallVec;πuse thin_vec::ThinVec;πuse crate::Interner;π
TraitsΒ§
- Generic
Type Visitable - This trait is implemented for every type that can be visited, providing the skeleton of the traversal.