rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.#66907
Merged
bors merged 1 commit intorust-lang:masterfrom Dec 2, 2019
Merged
rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.#66907bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: these
fmt::Debugimpls only get used with-Z verbose(which some tests use).I was going to print the path like in #66850 (or rather, use
DefId'sfmt::Debug, which is close but not as nice), but then I realized that most of theDefIds werecrate0: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
BrNamedthat now print the full path to the lifetime parameter, and everything else is shorter instead, which doesn't feel too bad.cc @nikomatsakis