Skip to content

Commit

Permalink
Improve bug! message for impossible case in Relate
Browse files Browse the repository at this point in the history
Hitting this branch in Clippy and I think it makes sense to print
both values here in case other people hit this branch, too.
  • Loading branch information
phansch committed Sep 29, 2018
1 parent 6622172 commit d654e3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc/ty/relate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,12 @@ impl<'tcx> Relate<'tcx> for Kind<'tcx> {
(UnpackedKind::Type(a_ty), UnpackedKind::Type(b_ty)) => {
Ok(relation.relate(&a_ty, &b_ty)?.into())
}
(UnpackedKind::Lifetime(_), _) | (UnpackedKind::Type(_), _) => bug!()
(UnpackedKind::Lifetime(unpacked), x) => {
bug!("impossible case reached: can't relate: {:?} with {:?}", unpacked, x)
}
(UnpackedKind::Type(unpacked), x) => {
bug!("impossible case reached: can't relate: {:?} with {:?}", unpacked, x)
}
}
}
}
Expand Down

0 comments on commit d654e3c

Please sign in to comment.