Skip to content

Commit 453affa

Browse files
committed
Auto merge of #1820 - Aaron1011:rustup-const-err, r=RalfJung
Rustup for const_err changes
2 parents 178ae8e + 73700bc commit 453affa

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ce0d64e03ef9875e0935bb60e989542b7ec29579
1+
d9feaaa548ce380159a1de68f4f6e605db9a9fc5

src/diagnostics.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ pub fn report_error<'tcx, 'mir>(
8484
"resource exhaustion",
8585
InvalidProgram(InvalidProgramInfo::ReferencedConstant) =>
8686
"post-monomorphization error",
87-
_ =>
88-
bug!("This error should be impossible in Miri: {}", e),
87+
InvalidProgram(InvalidProgramInfo::AlreadyReported(_)) =>
88+
"error occurred",
89+
kind =>
90+
bug!("This error should be impossible in Miri: {:?}", kind),
8991
};
9092
#[rustfmt::skip]
9193
let helps = match e.kind() {

tests/compile-fail/erroneous_const.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88

99
struct PrintName<T>(T);
1010
impl<T> PrintName<T> {
11-
const VOID: ! = panic!(); //~WARN any use of this value will cause an error
12-
//~^ WARN this was previously accepted
11+
const VOID: ! = panic!(); //~ERROR any use of this value will cause an error
1312
}
1413

1514
fn no_codegen<T>() {
1615
if false {
17-
let _ = PrintName::<T>::VOID; //~ERROR referenced constant has errors
16+
let _ = PrintName::<T>::VOID; //~ERROR error occurred: encountered constant
1817
}
1918
}
2019
fn main() {

0 commit comments

Comments
 (0)