Skip to content

Conversation

@jacob-greenfield
Copy link
Contributor

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).

@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2025

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2025

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a

@makai410
Copy link
Contributor

Thanks! Could you please add an ui-test for that, if it's not too much work

@scottmcm
Copy link
Member

Sorry, while I volunteered to help with reviews here I don't really know intent for stuff like this, so re-rolling
r? project-stable-mir

@rustbot rustbot assigned oli-obk and unassigned scottmcm Jul 24, 2025
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. Can you please add a test to the new API? You can just augment https://github.com/rust-lang/rust/blob/master/tests/ui-fulldeps/rustc_public/check_defs.rs

r=me when you are done

Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops... wrong checkbox.

@celinval
Copy link
Contributor

r? celinval

@rustbot rustbot assigned celinval and unassigned oli-obk Jul 25, 2025
@Dylan-DPC Dylan-DPC added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 1, 2025
@Dylan-DPC
Copy link
Member

@jacob-greenfield can you add the test required for this? that's the only thing pending here.

@bors
Copy link
Collaborator

bors commented Oct 30, 2025

☔ The latest upstream changes (presumably #148280) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants