make Debug
impl for Term
simpler
This commit is contained in:
parent
84b9b6d16c
commit
006866f558
1 changed files with 4 additions and 8 deletions
|
@ -536,14 +536,10 @@ unsafe impl<'tcx> Sync for Term<'tcx> where &'tcx (Ty<'tcx>, Const<'tcx>): Sync
|
||||||
|
|
||||||
impl Debug for Term<'_> {
|
impl Debug for Term<'_> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
let data = if let Some(ty) = self.ty() {
|
match self.unpack() {
|
||||||
format!("Term::Ty({ty:?})")
|
TermKind::Ty(ty) => write!(f, "Term::Ty({ty:?})"),
|
||||||
} else if let Some(ct) = self.ct() {
|
TermKind::Const(ct) => write!(f, "Term::Const({ct:?})"),
|
||||||
format!("Term::Ct({ct:?})")
|
}
|
||||||
} else {
|
|
||||||
unreachable!()
|
|
||||||
};
|
|
||||||
f.write_str(&data)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue