-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make Debug
impl for Term
useful
#101587
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make Debug
impl for Term
useful
#101587
Conversation
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
r=me when ci is green, since i am out at lunch |
@bors r= compiler-errors |
@bors r- |
@bors r+ rollup |
pub struct Term<'tcx> { | ||
ptr: NonZeroUsize, | ||
marker: PhantomData<(Ty<'tcx>, Const<'tcx>)>, | ||
} | ||
|
||
impl Debug for Term<'_> { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
let data = if let Some(ty) = self.ty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a nit but shouldn't this just match on self.unpack()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xd I didn't know that method existed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this just print unpack()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#101423 (Fix hermit warnings) - rust-lang#101499 (Introduce lowering_arena to avoid creating AST nodes on the fly) - rust-lang#101530 (llvm-wrapper: adapt for LLVM API changes) - rust-lang#101554 (rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`) - rust-lang#101580 (rustdoc: remove unused CSS `div.impl-items > div`) - rust-lang#101584 (rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`) - rust-lang#101587 (Make `Debug` impl for `Term` useful) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
because
Term { ptr: 78942378998734298342, maker: PhantomData, }
does not excel at communicating the necessary information