1
Fork 0

Auto merge of #50841 - oli-obk:promote_errors_to_panics, r=eddyb

Don't lint numeric overflows in promoteds in release mode

r? @eddyb

mitigates #50814
This commit is contained in:
bors 2018-05-20 11:13:24 +00:00
commit 22c25dd737
9 changed files with 134 additions and 34 deletions

View file

@ -413,10 +413,10 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
.unwrap_or_else(|err| {
match constant.literal {
mir::Literal::Promoted { .. } => {
// don't report errors inside promoteds, just warnings.
// FIXME: generate a panic here
},
mir::Literal::Value { .. } => {
err.report(bx.tcx(), constant.span, "const operand")
err.report(bx.tcx(), constant.span, "const operand");
},
}
// We've errored, so we don't have to produce working code.