Skip to content

rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.#66907

Merged
bors merged 1 commit intorust-lang:masterfrom
eddyb:br-nicer-named
Dec 2, 2019
Merged

rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.#66907
bors merged 1 commit intorust-lang:masterfrom
eddyb:br-nicer-named

Conversation

@eddyb
Copy link
Copy Markdown
Member

@eddyb eddyb commented Nov 30, 2019

Context: these fmt::Debug impls only get used with -Z verbose (which some tests use).

I was going to print the path like in #66850 (or rather, use DefId's fmt::Debug, which is close but not as nice), but then I realized that most of the DefIds were crate0:DefIndex(0), i.e. the crate root.
As the crate root is not a lifetime, they're clearly dummies of some sort, and we don't have to print anything other than the name for them.

This means that out of all the tests, there's only 5 instances of BrNamed that now print the full path to the lifetime parameter, and everything else is shorter instead, which doesn't feel too bad.

cc @nikomatsakis

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants