diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-09 00:20:33 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-09 00:20:37 +0000 |
| commit | 80e9ca93981f6fa8fae4e95111b78b9093348b2c (patch) | |
| tree | f934cf234db17bf1c124cd2751c142c1d0f90cf4 | |
| parent | a77659a1e1807ba567f513afe59115af2604dc30 (diff) | |
| download | rust-80e9ca93981f6fa8fae4e95111b78b9093348b2c.tar.gz rust-80e9ca93981f6fa8fae4e95111b78b9093348b2c.zip | |
Don't print Interned or PrivateZst
| -rw-r--r-- | compiler/rustc_data_structures/src/intern.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/intern.rs b/compiler/rustc_data_structures/src/intern.rs index ba94f3776eb..e0f8c350c2a 100644 --- a/compiler/rustc_data_structures/src/intern.rs +++ b/compiler/rustc_data_structures/src/intern.rs @@ -1,5 +1,6 @@ use crate::stable_hasher::{HashStable, StableHasher}; use std::cmp::Ordering; +use std::fmt::{self, Debug}; use std::hash::{Hash, Hasher}; use std::ops::Deref; use std::ptr; @@ -20,7 +21,6 @@ mod private { /// The `PrivateZst` field means you can pattern match with `Interned(v, _)` /// but you can only construct a `Interned` with `new_unchecked`, and not /// directly. -#[derive(Debug)] #[rustc_pass_by_value] pub struct Interned<'a, T>(pub &'a T, pub private::PrivateZst); @@ -108,5 +108,11 @@ where } } +impl<T: Debug> Debug for Interned<'_, T> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.0.fmt(f) + } +} + #[cfg(test)] mod tests; |
