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

Layout errors can happen because something was too generic

上级 cce53b36
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
use mir; use mir;
use ty::{Ty, layout}; use ty::{Ty, layout};
use ty::layout::{Size, Align}; use ty::layout::{Size, Align, LayoutError};
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;
use super::{ use super::{
...@@ -113,9 +113,10 @@ fn struct_generic( ...@@ -113,9 +113,10 @@ fn struct_generic(
lint_root: Option<ast::NodeId>, lint_root: Option<ast::NodeId>,
) -> Result<DiagnosticBuilder<'tcx>, ErrorHandled> { ) -> Result<DiagnosticBuilder<'tcx>, ErrorHandled> {
match self.error.kind { match self.error.kind {
EvalErrorKind::Layout(LayoutError::Unknown(_)) |
EvalErrorKind::TooGeneric => return Err(ErrorHandled::TooGeneric), EvalErrorKind::TooGeneric => return Err(ErrorHandled::TooGeneric),
EvalErrorKind::TypeckError | EvalErrorKind::Layout(LayoutError::SizeOverflow(_)) |
EvalErrorKind::Layout(_) => return Err(ErrorHandled::Reported), EvalErrorKind::TypeckError => return Err(ErrorHandled::Reported),
_ => {}, _ => {},
} }
trace!("reporting const eval failure at {:?}", self.span); 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.
先完成此消息的编辑!
想要评论请 注册