From 73700bc01c25c4bdf08a99803eee09ea4ca32fac Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Mon, 31 May 2021 10:50:25 -0500 Subject: [PATCH] Rustup for const_err changes --- rust-version | 2 +- src/diagnostics.rs | 6 ++++-- tests/compile-fail/erroneous_const.rs | 5 ++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/rust-version b/rust-version index 7fc12e477e28..089b4f55511b 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -ce0d64e03ef9875e0935bb60e989542b7ec29579 +d9feaaa548ce380159a1de68f4f6e605db9a9fc5 diff --git a/src/diagnostics.rs b/src/diagnostics.rs index ae50b5086022..456b6fb4d419 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -84,8 +84,10 @@ pub fn report_error<'tcx, 'mir>( "resource exhaustion", InvalidProgram(InvalidProgramInfo::ReferencedConstant) => "post-monomorphization error", - _ => - bug!("This error should be impossible in Miri: {}", e), + InvalidProgram(InvalidProgramInfo::AlreadyReported(_)) => + "error occurred", + kind => + bug!("This error should be impossible in Miri: {:?}", kind), }; #[rustfmt::skip] let helps = match e.kind() { diff --git a/tests/compile-fail/erroneous_const.rs b/tests/compile-fail/erroneous_const.rs index 49dcea62a243..f193dee94ebc 100644 --- a/tests/compile-fail/erroneous_const.rs +++ b/tests/compile-fail/erroneous_const.rs @@ -8,13 +8,12 @@ struct PrintName(T); impl PrintName { - const VOID: ! = panic!(); //~WARN any use of this value will cause an error - //~^ WARN this was previously accepted + const VOID: ! = panic!(); //~ERROR any use of this value will cause an error } fn no_codegen() { if false { - let _ = PrintName::::VOID; //~ERROR referenced constant has errors + let _ = PrintName::::VOID; //~ERROR error occurred: encountered constant } } fn main() {