Open
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
orstd::os::raw::c_char
, depending on context) - Get a
Path
for a givenItem
- 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