Skip to content

Commit af28c2e

Browse files
author
Jeffrey Griffin
committed
fix ui tests referencing pointer-to-integer cast error message
1 parent ff315e3 commit af28c2e

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/test/ui/consts/const-eval/const_raw_ptr_ops2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
44
LL | const Y2: usize = unsafe { &1 as *const i32 as usize + 1 };
55
| ---------------------------^^^^^^^^^^^^^^^^^^^^^^^^^-------
66
| |
7-
| "pointer-to-integer cast" needs an rfc before being allowed inside constants
7+
| cannot cast pointer to integer because it was not created by cast from integer
88
|
99
= note: `#[deny(const_err)]` on by default
1010
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
44
LL | pub const FOO: usize = unsafe { BAR as usize };
55
| --------------------------------^^^^^^^^^^^^---
66
| |
7-
| "pointer-to-integer cast" needs an rfc before being allowed inside constants
7+
| cannot cast pointer to integer because it was not created by cast from integer
88
|
99
= note: `#[deny(const_err)]` on by default
1010
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed
2020
--> $DIR/issue-52432.rs:7:10
2121
|
2222
LL | [(); &(static || {}) as *const _ as usize];
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot cast pointer to integer because it was not created by cast from integer
2424

2525
error: aborting due to 4 previous errors
2626

src/test/ui/consts/miri_unleashed/ptr_arith.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static INT_PTR_ARITH: () = unsafe {
1515
let x: usize = std::mem::transmute(&0);
1616
let _v = x + 0;
1717
//~^ ERROR could not evaluate static initializer
18-
//~| NOTE pointer-to-integer cast
18+
//~| NOTE cannot cast pointer to integer
1919
};
2020

2121
fn main() {}

src/test/ui/consts/miri_unleashed/ptr_arith.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0080]: could not evaluate static initializer
88
--> $DIR/ptr_arith.rs:16:14
99
|
1010
LL | let _v = x + 0;
11-
| ^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants
11+
| ^^^^^ cannot cast pointer to integer because it was not created by cast from integer
1212

1313
warning: skipping const checks
1414
|

src/test/ui/consts/ptr_comparisons.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ const _: *const u8 =
7171

7272
const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
7373
//~^ ERROR any use of this value will cause an error
74-
//~| NOTE "pointer-to-integer cast" needs an rfc
74+
//~| NOTE cannot cast pointer to integer
7575
//~| NOTE
7676
//~| WARN this was previously accepted by the compiler but is being phased out
7777
//~| NOTE
7878

7979
const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
8080
//~^ ERROR any use of this value will cause an error
81-
//~| NOTE "pointer-to-integer cast" needs an rfc
81+
//~| NOTE cannot cast pointer to integer
8282
//~| NOTE
8383
//~| WARN this was previously accepted by the compiler but is being phased out
8484
//~| NOTE

src/test/ui/consts/ptr_comparisons.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ error: any use of this value will cause an error
3636
LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
3737
| --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
3838
| |
39-
| "pointer-to-integer cast" needs an rfc before being allowed inside constants
39+
| cannot cast pointer to integer because it was not created by cast from integer
4040
|
4141
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
4242
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
@@ -47,7 +47,7 @@ error: any use of this value will cause an error
4747
LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
4848
| --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
4949
| |
50-
| "pointer-to-integer cast" needs an rfc before being allowed inside constants
50+
| cannot cast pointer to integer because it was not created by cast from integer
5151
|
5252
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5353
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>

0 commit comments

Comments
 (0)