Skip to content

Commit 12a29d9

Browse files
committed
fix rebase fallout
1 parent 42aedec commit 12a29d9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/test/ui/consts/issue-51559.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
const BAR: *mut () = ((|| 3) as fn() -> i32) as *mut ();
44
pub const FOO: usize = unsafe { BAR as usize };
5-
//~^ ERROR it is undefined behavior to use this value
5+
//~^ ERROR any use of this value will cause an error
66

77
fn main() {}

src/test/ui/consts/issue-51559.stderr

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/issue-51559.rs:4:1
1+
error: any use of this value will cause an error
2+
--> $DIR/issue-51559.rs:4:33
33
|
44
LL | pub const FOO: usize = unsafe { BAR as usize };
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
5+
| --------------------------------^^^^^^^^^^^^---
6+
| |
7+
| "pointer-to-integer cast" needs an rfc before being allowed inside constants
68
|
7-
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
9+
= note: `#[deny(const_err)]` on by default
810

911
error: aborting due to previous error
1012

11-
For more information about this error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)