提交 6f84d6ed 编写于 作者: O Oliver Schneider 提交者: Oliver Scherer

Layout errors can happen because something was too generic

上级 cce53b36
......@@ -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<ast::NodeId>,
) -> Result<DiagnosticBuilder<'tcx>, 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册