Skip to content

Commit fb010c9

Browse files
committed
bless missing tests
1 parent 5f0dd6d commit fb010c9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/test/ui/issues/issue-18294.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
22
const X: u32 = 1;
3-
const Y: usize = unsafe { &X as *const u32 as usize }; //~ ERROR is unstable
3+
const Y: usize = unsafe { &X as *const u32 as usize }; //~ ERROR pointers cannot be cast to integers
44
println!("{}", Y);
55
}

src/test/ui/issues/issue-18294.stderr

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
error[E0658]: casting pointers to integers in constants is unstable
1+
error: pointers cannot be cast to integers during const eval.
22
--> $DIR/issue-18294.rs:3:31
33
|
44
LL | const Y: usize = unsafe { &X as *const u32 as usize };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information
8-
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
7+
= note: at compile-time, pointers do not have an integer value
8+
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
99

1010
error: aborting due to previous error
1111

12-
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)