-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl. #66907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
//! hand, though we've recently added some macros and proc-macros to help with the tedium. | ||
|
||
use crate::hir::def::Namespace; | ||
use crate::hir::def_id::CRATE_DEF_INDEX; | ||
use crate::mir::ProjectionKind; | ||
use crate::mir::interpret; | ||
use crate::ty::{self, Lift, Ty, TyCtxt, InferConst}; | ||
|
@@ -95,8 +96,11 @@ impl fmt::Debug for ty::BoundRegion { | |
match *self { | ||
ty::BrAnon(n) => write!(f, "BrAnon({:?})", n), | ||
ty::BrNamed(did, name) => { | ||
write!(f, "BrNamed({:?}:{:?}, {})", | ||
did.krate, did.index, name) | ||
if did.index == CRATE_DEF_INDEX { | ||
write!(f, "BrNamed({})", name) | ||
} else { | ||
write!(f, "BrNamed({:?}, {})", did, name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if this is easily done, but can you eliminate the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's rare enough that I don't want to touch that right now. |
||
} | ||
} | ||
ty::BrEnv => write!(f, "BrEnv"), | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.