mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 15:56:09 +03:00
3a0187ec5d
Add `DefId::parent()` accessor for `rustc_public` Adds a `parent()` method to `DefId` (the `rustc_pub` version) which exposes the parent path, ie. `foo::bar::baz` -> `foo::bar`. This is useful for organizing/grouping definitions into a tree, and is probably simpler and less brittle than attempting to parse the fully-qualified name into path components (e.g. especially when handling path components with qualified generic parameters).