From b9db95edb1136de4230bb2e130c4e09b06f7f3a7 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 1 Aug 2019 09:12:48 +0200 Subject: [PATCH] fix rebase fallout --- src/test/ui/consts/issue-51559.rs | 2 +- src/test/ui/consts/issue-51559.stderr | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/ui/consts/issue-51559.rs b/src/test/ui/consts/issue-51559.rs index 429947269385..69f0d8df0aa4 100644 --- a/src/test/ui/consts/issue-51559.rs +++ b/src/test/ui/consts/issue-51559.rs @@ -2,6 +2,6 @@ const BAR: *mut () = ((|| 3) as fn() -> i32) as *mut (); pub const FOO: usize = unsafe { BAR as usize }; -//~^ ERROR it is undefined behavior to use this value +//~^ ERROR any use of this value will cause an error fn main() {} diff --git a/src/test/ui/consts/issue-51559.stderr b/src/test/ui/consts/issue-51559.stderr index 917c54ddaef1..4d50ec818bce 100644 --- a/src/test/ui/consts/issue-51559.stderr +++ b/src/test/ui/consts/issue-51559.stderr @@ -1,11 +1,12 @@ -error[E0080]: it is undefined behavior to use this value - --> $DIR/issue-51559.rs:4:1 +error: any use of this value will cause an error + --> $DIR/issue-51559.rs:4:33 | LL | pub const FOO: usize = unsafe { BAR as usize }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes + | --------------------------------^^^^^^^^^^^^--- + | | + | "pointer-to-integer cast" needs an rfc before being allowed inside constants | - = 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 + = note: `#[deny(const_err)]` on by default error: aborting due to previous error -For more information about this error, try `rustc --explain E0080`.