diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs index acdabd1e53d63..05978ae3c6f7a 100644 --- a/src/librustc/mir/interpret/error.rs +++ b/src/librustc/mir/interpret/error.rs @@ -144,7 +144,7 @@ impl<'tcx> ConstEvalErr<'tcx> { return Err(ErrorHandled::TooGeneric), err_inval!(TypeckError) => return Err(ErrorHandled::Reported), - err_inval!(LayoutError::SizeOverflow(_)) => must_error = true, + err_inval!(Layout(LayoutError::SizeOverflow(_))) => must_error = true, _ => {}, } trace!("reporting const eval failure at {:?}", self.span); @@ -336,7 +336,7 @@ impl fmt::Debug for InvalidProgramInfo<'tcx> { TypeckError => write!(f, "encountered constants with type errors, stopping evaluation"), Layout(ref err) => - write!(f, "rustc layout computation failed: {:?}", err), + write!(f, "{}", err), } } } diff --git a/src/test/ui/consts/issue-55878.stderr b/src/test/ui/consts/issue-55878.stderr index 7ca7024912fbb..adb272f4bed9c 100644 --- a/src/test/ui/consts/issue-55878.stderr +++ b/src/test/ui/consts/issue-55878.stderr @@ -2,7 +2,7 @@ error[E0080]: reaching this expression at runtime will panic or abort --> $SRC_DIR/libcore/mem/mod.rs:LL:COL | LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ rustc layout computation failed: SizeOverflow([u8; 18446744073709551615]) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `[u8; 18446744073709551615]` is too big for the current architecture | ::: $DIR/issue-55878.rs:3:26 | diff --git a/src/test/ui/issues/issue-56762.stderr b/src/test/ui/issues/issue-56762.stderr index fa7b9c71eb4a2..bce95087c5ce4 100644 --- a/src/test/ui/issues/issue-56762.stderr +++ b/src/test/ui/issues/issue-56762.stderr @@ -2,13 +2,13 @@ error[E0080]: could not evaluate static initializer --> $DIR/issue-56762.rs:19:1 | LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustc layout computation failed: SizeOverflow([u8; 2305843009213693951]) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `[u8; 2305843009213693951]` is too big for the current architecture error[E0080]: could not evaluate static initializer --> $DIR/issue-56762.rs:21:1 | LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustc layout computation failed: SizeOverflow([u8; 2305843009213693951]) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `[u8; 2305843009213693951]` is too big for the current architecture error: aborting due to 2 previous errors