Skip to content

Commit d654e3c

Browse files
committed
Improve bug! message for impossible case in Relate
Hitting this branch in Clippy and I think it makes sense to print both values here in case other people hit this branch, too.
1 parent 6622172 commit d654e3c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc/ty/relate.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,12 @@ impl<'tcx> Relate<'tcx> for Kind<'tcx> {
702702
(UnpackedKind::Type(a_ty), UnpackedKind::Type(b_ty)) => {
703703
Ok(relation.relate(&a_ty, &b_ty)?.into())
704704
}
705-
(UnpackedKind::Lifetime(_), _) | (UnpackedKind::Type(_), _) => bug!()
705+
(UnpackedKind::Lifetime(unpacked), x) => {
706+
bug!("impossible case reached: can't relate: {:?} with {:?}", unpacked, x)
707+
}
708+
(UnpackedKind::Type(unpacked), x) => {
709+
bug!("impossible case reached: can't relate: {:?} with {:?}", unpacked, x)
710+
}
706711
}
707712
}
708713
}

0 commit comments

Comments
 (0)