Giter Site home page Giter Site logo

Comments (6)

Michael-F-Bryan avatar Michael-F-Bryan commented on May 23, 2024

I'd be happy to write this up but I'll probably need a little guidance because I only know how to do the second thing (find DefId) at the moment.

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on May 23, 2024

I don't even know enough to know what is a common operation, but something like that would definitely be helpful. Something like a cookbook appendix...

from rustc-dev-guide.

Michael-F-Bryan avatar Michael-F-Bryan commented on May 23, 2024

To be honest, I was planning to use it as more of a "post questions here if Michael can't figure out how to do something seemingly simple" kind of thing.

For example, I know we do name resolution before rustc_driver fires the after_analysis callback, yet for the life of me I can't figure out how to get the fully qualified name for all a type. For context, I need to convert something like fn inc(a: c_int) -> c_int into fn inc(a: ::std::os::raw::c_int) -> ::std::os::raw::c_int.

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on May 23, 2024

How to get a string from a Span (e.g. for printing errors)... Use codemap.span_to_snippet(span)

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on May 23, 2024

How to get the parent of a defid (e.g. the module of an item): https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20get.20the.20module.20that.20an.20Item.20belongs.20to.3F

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on May 23, 2024

How to get an Item from a DefId: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20get.20an.20Item.20from.20a.20DefId.3F

Also, would be good to talk about def_kind

from rustc-dev-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.