File tree 7 files changed +9
-9
lines changed
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
4
4
LL | const Y2: usize = unsafe { &1 as *const i32 as usize + 1 };
5
5
| ---------------------------^^^^^^^^^^^^^^^^^^^^^^^^^-------
6
6
| |
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
8
8
|
9
9
= note: `#[deny(const_err)]` on by default
10
10
= 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
4
4
LL | pub const FOO: usize = unsafe { BAR as usize };
5
5
| --------------------------------^^^^^^^^^^^^---
6
6
| |
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
8
8
|
9
9
= note: `#[deny(const_err)]` on by default
10
10
= 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
20
20
--> $DIR/issue-52432.rs:7:10
21
21
|
22
22
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
24
24
25
25
error: aborting due to 4 previous errors
26
26
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ static INT_PTR_ARITH: () = unsafe {
15
15
let x: usize = std:: mem:: transmute ( & 0 ) ;
16
16
let _v = x + 0 ;
17
17
//~^ ERROR could not evaluate static initializer
18
- //~| NOTE pointer-to-integer cast
18
+ //~| NOTE cannot cast pointer to integer
19
19
} ;
20
20
21
21
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ error[E0080]: could not evaluate static initializer
8
8
--> $DIR/ptr_arith.rs:16:14
9
9
|
10
10
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
12
12
13
13
warning: skipping const checks
14
14
|
Original file line number Diff line number Diff line change @@ -71,14 +71,14 @@ const _: *const u8 =
71
71
72
72
const _: usize = unsafe { std:: mem:: transmute :: < * const usize , usize > ( FOO ) + 4 } ;
73
73
//~^ 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
75
75
//~| NOTE
76
76
//~| WARN this was previously accepted by the compiler but is being phased out
77
77
//~| NOTE
78
78
79
79
const _: usize = unsafe { * std:: mem:: transmute :: < & & usize , & usize > ( & FOO ) + 4 } ;
80
80
//~^ 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
82
82
//~| NOTE
83
83
//~| WARN this was previously accepted by the compiler but is being phased out
84
84
//~| 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
36
36
LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
37
37
| --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
38
38
| |
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
40
40
|
41
41
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
42
42
= 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
47
47
LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
48
48
| --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
49
49
| |
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
51
51
|
52
52
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
53
53
= 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