diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs index f7f4c50b96d40bf6acc9d75c777c11a5297e36a9..75ce9b55c503774b8d0cc03a0dbbb813bde85a75 100644 --- a/src/librustc/mir/interpret/error.rs +++ b/src/librustc/mir/interpret/error.rs @@ -12,7 +12,7 @@ use mir; use ty::{Ty, layout}; -use ty::layout::{Size, Align}; +use ty::layout::{Size, Align, LayoutError}; use rustc_target::spec::abi::Abi; use super::{ @@ -113,9 +113,10 @@ fn struct_generic( lint_root: Option, ) -> Result, ErrorHandled> { match self.error.kind { + EvalErrorKind::Layout(LayoutError::Unknown(_)) | EvalErrorKind::TooGeneric => return Err(ErrorHandled::TooGeneric), - EvalErrorKind::TypeckError | - EvalErrorKind::Layout(_) => return Err(ErrorHandled::Reported), + EvalErrorKind::Layout(LayoutError::SizeOverflow(_)) | + EvalErrorKind::TypeckError => return Err(ErrorHandled::Reported), _ => {}, } trace!("reporting const eval failure at {:?}", self.span);