Skip to content

Commit b4f78c0

Browse files
committed
Improve debugging output of layout computation failure
1 parent aba5160 commit b4f78c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc/ty/sty.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1975,9 +1975,10 @@ impl<'tcx> Const<'tcx> {
19751975
ty: ParamEnvAnd<'tcx, Ty<'tcx>>,
19761976
) -> &'tcx Self {
19771977
let ty = tcx.lift_to_global(&ty).unwrap();
1978-
let layout = tcx.layout_of(ty).unwrap_or_else(|_| {
1978+
let layout = tcx.layout_of(ty).unwrap_or_else(|e| {
19791979
// FIXME: add delay_span_bug call, we can only get here if there are errors
19801980
// we produce a weird dummy layout with somewhat sane values
1981+
error!("failed to compute layout of {:?}: {:?}", ty, e);
19811982
let mut layout = tcx.layout_of(ParamEnv::reveal_all().and(tcx.types.u128)).unwrap();
19821983
layout.ty = ty.value;
19831984
layout

0 commit comments

Comments
 (0)