Skip to content

Document common manipulations and operations #91

Open
@Michael-F-Bryan

Description

@Michael-F-Bryan

While playing around using rustc internals as a library I found it was pretty difficult to discover how to do a bunch of "common" operations. We might be able to improve discoverability by documenting these in an appendix.

Off the top of my head, it'd be nice to know how to:

  • Get the fully qualified name of a type given its HIR representation and location (e.g. c_char -> libc::c_char or std::os::raw::c_char, depending on context)
  • Get a Path for a given Item
  • Find the DefId of a function or struct declaration
  • How to pretty-print a function declaration

Feel free to add other "common" questions or shortcuts in the comments and I'll update this list accordingly.

CC: #74

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-onboardingArea: contributor on-boarding advice (e.g. for new contributors)A-examplesArea: examplesC-enhancementCategory: enhancementE-help-wantedCall for participation: extra help is wantedE-mediumDifficulty: might require some prior knowledge or code readingT-compilerRelevant to compiler team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions