Expose more info about ADTs and functions in rustc_public#157993
Conversation
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@makai410 - gentle ping on this in case this fell off of your radar. Happy to make any changes, or talk through it here over zulip. |
|
Sorry for the delay. I've been busy irl, but I'll be able to review this after July 5th. |
makai410
left a comment
There was a problem hiding this comment.
Thanks! The overall changes look good to me, r=me when you resolve the comment.
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
This allows users of `rustc_public` to do more complex navigation through data structures by exposing the following info: * `AdtDef::generics_of` - Get the generics for the ADT. * `AdtDef::inherent_impls` - Get all the impls for the ADT. * `FnDef::associated_item` - Get the trait or impl block that contains the function if it exists. * `FnDef::generics_of` - get the generics for a given function. * `ImplDef::generics_of` - Get the generics for the impl block. * `ImplDef` implements `CrateDefType` - figure out the type of the impl block with `CrateDefType::ty()` or get the normalized type with `CrateDefType::ty_with_args()`. This was partially written with the help of Gemini, but I reviewed the code it generated.
|
@rustbot ready |
Expose more info about ADTs and functions in rustc_public This allows users of `rustc_public` to do more complex navigation through data structures by exposing the following info: * `AdtDef::generics_of` - Get the generics for the ADT. * `AdtDef::inherent_impls` - Get all the impls for the ADT. * `FnDef::associated_item` - Get the trait or impl block that contains the function if it exists. * `FnDef::generics_of` - get the generics for a given function. * `ImplDef::generics_of` - Get the generics for the impl block. * `ImplDef` implements `CrateDefType` - figure out the type of the impl block with `CrateDefType::ty()` or get the normalized type with `CrateDefType::ty_with_args()`. This was partially written with the help of Gemini, but I reviewed the code it generated.
…uwer Rollup of 14 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #158846 (Fix unused variable warnings for diverging expressions) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
Expose more info about ADTs and functions in rustc_public This allows users of `rustc_public` to do more complex navigation through data structures by exposing the following info: * `AdtDef::generics_of` - Get the generics for the ADT. * `AdtDef::inherent_impls` - Get all the impls for the ADT. * `FnDef::associated_item` - Get the trait or impl block that contains the function if it exists. * `FnDef::generics_of` - get the generics for a given function. * `ImplDef::generics_of` - Get the generics for the impl block. * `ImplDef` implements `CrateDefType` - figure out the type of the impl block with `CrateDefType::ty()` or get the normalized type with `CrateDefType::ty_with_args()`. This was partially written with the help of Gemini, but I reviewed the code it generated.
…uwer Rollup of 15 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #156047 (Fix trait method resolution on an adjusted never type) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #158846 (Fix unused variable warnings for diverging expressions) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
…uwer Rollup of 13 pull requests Successful merges: - #157706 (Deny `todo!()` in tidy) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #158846 (Fix unused variable warnings for diverging expressions) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
Rollup merge of #157993 - erickt:rustc-public, r=makai410 Expose more info about ADTs and functions in rustc_public This allows users of `rustc_public` to do more complex navigation through data structures by exposing the following info: * `AdtDef::generics_of` - Get the generics for the ADT. * `AdtDef::inherent_impls` - Get all the impls for the ADT. * `FnDef::associated_item` - Get the trait or impl block that contains the function if it exists. * `FnDef::generics_of` - get the generics for a given function. * `ImplDef::generics_of` - Get the generics for the impl block. * `ImplDef` implements `CrateDefType` - figure out the type of the impl block with `CrateDefType::ty()` or get the normalized type with `CrateDefType::ty_with_args()`. This was partially written with the help of Gemini, but I reviewed the code it generated.
This allows users of
rustc_publicto do more complex navigation through data structures by exposing the following info:AdtDef::generics_of- Get the generics for the ADT.AdtDef::inherent_impls- Get all the impls for the ADT.FnDef::associated_item- Get the trait or impl block that contains the function if it exists.FnDef::generics_of- get the generics for a given function.ImplDef::generics_of- Get the generics for the impl block.ImplDefimplementsCrateDefType- figure out the type of the impl block withCrateDefType::ty()or get the normalized type withCrateDefType::ty_with_args().This was partially written with the help of Gemini, but I reviewed the code it generated.