Do not lint on SizeOverflow, always error
This commit is contained in:
parent
83b5eb9615
commit
58bd8786e8
@ -137,16 +137,18 @@ impl<'tcx> ConstEvalErr<'tcx> {
|
||||
message: &str,
|
||||
lint_root: Option<hir::HirId>,
|
||||
) -> Result<DiagnosticBuilder<'tcx>, ErrorHandled> {
|
||||
let mut must_error = false;
|
||||
match self.error {
|
||||
err_inval!(Layout(LayoutError::Unknown(_))) |
|
||||
err_inval!(TooGeneric) =>
|
||||
return Err(ErrorHandled::TooGeneric),
|
||||
err_inval!(TypeckError) =>
|
||||
return Err(ErrorHandled::Reported),
|
||||
err_inval!(LayoutError::SizeOverflow(_)) => must_error = true,
|
||||
_ => {},
|
||||
}
|
||||
trace!("reporting const eval failure at {:?}", self.span);
|
||||
let mut err = if let Some(lint_root) = lint_root {
|
||||
let mut err = if let (Some(lint_root), false) = (lint_root, must_error) {
|
||||
let hir_id = self.stacktrace
|
||||
.iter()
|
||||
.rev()
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: reaching this expression at runtime will panic or abort
|
||||
error[E0080]: reaching this expression at runtime will panic or abort
|
||||
--> $SRC_DIR/libcore/mem/mod.rs:LL:COL
|
||||
|
|
||||
LL | intrinsics::size_of::<T>()
|
||||
@ -8,8 +8,7 @@ LL | intrinsics::size_of::<T>()
|
||||
|
|
||||
LL | println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>());
|
||||
| ---------------------------------------------------
|
||||
|
|
||||
= note: `#[deny(const_err)]` on by default
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0080`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user