We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c5b8c7c + 006866f commit 131d48fCopy full SHA for 131d48f
compiler/rustc_middle/src/ty/mod.rs
@@ -536,14 +536,10 @@ unsafe impl<'tcx> Sync for Term<'tcx> where &'tcx (Ty<'tcx>, Const<'tcx>): Sync
536
537
impl Debug for Term<'_> {
538
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
539
- let data = if let Some(ty) = self.ty() {
540
- format!("Term::Ty({ty:?})")
541
- } else if let Some(ct) = self.ct() {
542
- format!("Term::Ct({ct:?})")
543
- } else {
544
- unreachable!()
545
- };
546
- f.write_str(&data)
+ match self.unpack() {
+ TermKind::Ty(ty) => write!(f, "Term::Ty({ty:?})"),
+ TermKind::Const(ct) => write!(f, "Term::Const({ct:?})"),
+ }
547
}
548
549
0 commit comments