rust-lang / rust-lang/rustc-dev-guide

Document common manipulations and operations

Open
#91 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-contributor-onboarding A-examples C-enhancement E-help-wanted E-medium T-compiler
Dominant language
HTML
Stars
1.9k
Forks
613
Avg merge
17h 24m
Merged PRs (30d)
39

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the rustc-dev-guide documentation and the four operations listed in this issue: qualified names, Paths, DefIds, and pretty-printing declarations. Check the comments for additional common questions; done means adding an appendix that documents these operations and any agreed additions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.