mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 13:05:18 +03:00
fix rebase fallout
This commit is contained in:
@@ -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() {}
|
||||
|
||||
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user