Hi, sorry if this thread is in wrong place. Just hoping to get quick answers for newbish questions when hacking on the compiler
I'm trying to improve a lint. Currently there's a span that could be narrower. So, I have a const definition like const A: bool = true; I also have a def_id of that definition. At the moment the span points to the whole definition. The thing I'm trying to get is the span of the item A itself. How can I do that?
My speculation is that I'd try to get a HirId of A (I presume it is a kind of node that has an HirId), and then somehow get it's associated span. Does that sound correct? What are the APIs I need to call?
Do you want the span of the identifier
@Jonas Schievink yes, that's correct
You should be able to use the HIR map to get the HIR node, which can give you the
Ident, and that has a span you can use
I'll see! Thanks.
Hi, I heard that I can ping this channel to get help to try https://github.com/rust-lang/rust/pull/72734#pullrequestreview-421079261 on rust-timer. Can anyone please help me on that?