File tree Expand file tree Collapse file tree 7 files changed +9
-9
lines changed Expand file tree Collapse file tree 7 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ error: any use of this value will cause an error
44LL | 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!
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ error: any use of this value will cause an error
44LL | 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!
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed
2020 --> $DIR/issue-52432.rs:7:10
2121 |
2222LL | [(); &(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
2525error: aborting due to 4 previous errors
2626
Original file line number Diff line number Diff 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
2121fn main ( ) { }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ error[E0080]: could not evaluate static initializer
88 --> $DIR/ptr_arith.rs:16:14
99 |
1010LL | 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
1313warning: skipping const checks
1414 |
Original file line number Diff line number Diff line change @@ -71,14 +71,14 @@ const _: *const u8 =
7171
7272const _: 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
7979const _: 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
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ error: any use of this value will cause an error
3636LL | 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
4747LL | 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>
You can’t perform that action at this time.
0 commit comments