Add a test showing the erroneous promoted bug

This commit is contained in:
Oliver Schneider 2018-05-18 09:41:24 +02:00
parent d81651e8e9
commit 27e710f557
3 changed files with 71 additions and 2 deletions

View file

@ -407,10 +407,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.