Skip to content

Commit

Permalink
Auto merge of #1820 - Aaron1011:rustup-const-err, r=RalfJung
Browse files Browse the repository at this point in the history
Rustup for const_err changes
  • Loading branch information
bors committed May 31, 2021
2 parents 178ae8e + 73700bc commit 453affa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ce0d64e03ef9875e0935bb60e989542b7ec29579
d9feaaa548ce380159a1de68f4f6e605db9a9fc5
6 changes: 4 additions & 2 deletions src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
5 changes: 2 additions & 3 deletions tests/compile-fail/erroneous_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

struct PrintName<T>(T);
impl<T> PrintName<T> {
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<T>() {
if false {
let _ = PrintName::<T>::VOID; //~ERROR referenced constant has errors
let _ = PrintName::<T>::VOID; //~ERROR error occurred: encountered constant
}
}
fn main() {
Expand Down

0 comments on commit 453affa

Please sign in to comment.