Layout errors can happen because something was too generic
This commit is contained in:
parent
cce53b3631
commit
6f84d6edf1
1 changed files with 4 additions and 3 deletions
|
@ -12,7 +12,7 @@ use std::{fmt, env};
|
||||||
|
|
||||||
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 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
|
||||||
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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue