We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a4490b1 + 80e9ca9 commit 009fc56Copy full SHA for 009fc56
compiler/rustc_data_structures/src/intern.rs
@@ -1,5 +1,6 @@
1
use crate::stable_hasher::{HashStable, StableHasher};
2
use std::cmp::Ordering;
3
+use std::fmt::{self, Debug};
4
use std::hash::{Hash, Hasher};
5
use std::ops::Deref;
6
use std::ptr;
@@ -20,7 +21,6 @@ mod private {
20
21
/// The `PrivateZst` field means you can pattern match with `Interned(v, _)`
22
/// but you can only construct a `Interned` with `new_unchecked`, and not
23
/// directly.
-#[derive(Debug)]
24
#[rustc_pass_by_value]
25
pub struct Interned<'a, T>(pub &'a T, pub private::PrivateZst);
26
@@ -108,5 +108,11 @@ where
108
}
109
110
111
+impl<T: Debug> Debug for Interned<'_, T> {
112
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
113
+ self.0.fmt(f)
114
+ }
115
+}
116
+
117
#[cfg(test)]
118
mod tests;
0 commit comments