Expand description
Rewrite module-relative paths inside an item that moves one level deeper.
When an item moves from module M into M::child, any path that was written
relative to M must gain one level:
super::X→super::super::Xself::X→super::X
Crucially this only applies at the item’s own module depth. A super:: written
inside a nested mod { … } within the item is relative to that nested module and
must be left alone. We track mod nesting with a syn::visit::Visit and only
rewrite at depth 0. Visibilities are handled separately (see crate::classify),
so we skip them here to avoid double-editing. Paths hidden inside macro token
streams are invisible to syn and therefore not rewritten — if one slips through,
the compiler-verification step rolls the whole split back.
Functions§
- relative_
path_ edits - Compute the path-rewrite edits (absolute byte coords) for one moved item.