rust-lang/rust — pull request #16419 by huonw (2014-08-11 12:28:46+00:00)
Title: Minor refactorings & implement --pretty expanded,hygiene to see syntax context & gensym information

Different Identifiers and Names can have identical textual representations, but different internal representations, due to the macro hygiene machinery (syntax contexts and gensyms). This provides a way to see these internals by compiling with `--pretty expanded,hygiene`.

This is useful for debugging & hacking on macros (e.g. diagnosing https://github.com/rust-lang/rust/issues/15750/https://github.com/rust-lang/rust/issues/15962 likely would've been faster with this functionality).

E.g.

```rust
#![feature(macro_rules)]
// minimal junk
#![no_std]

macro_rules! foo {
($x: ident) => { y + $x }
}

fn bar() {
foo!(x)
}
```
```rust
// minimal junk

fn bar /* 61#0 */() { y /* 60#2 */ + x /* 58#3 */ }
```