fix rebase fallout
This commit is contained in:
parent
0f97583e68
commit
b9db95edb1
2 changed files with 7 additions and 6 deletions
|
|
@ -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`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue