Skip to content

Commit 0ba2e80

Browse files
committed
bless all the things
1 parent 1f57eb0 commit 0ba2e80

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/test/ui/consts/const-eval/match-test-ptr-null.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: casting pointers to integers in constants is unstable
2-
--> $DIR/match-test-ptr-null.rs:7:15
2+
--> $DIR/match-test-ptr-null.rs:6:15
33
|
44
LL | match &1 as *const i32 as usize {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,19 +8,19 @@ LL | match &1 as *const i32 as usize {
88
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
99

1010
error[E0019]: constant contains unimplemented expression type
11-
--> $DIR/match-test-ptr-null.rs:7:15
11+
--> $DIR/match-test-ptr-null.rs:6:15
1212
|
1313
LL | match &1 as *const i32 as usize {
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^
1515

1616
error[E0019]: constant contains unimplemented expression type
17-
--> $DIR/match-test-ptr-null.rs:11:13
17+
--> $DIR/match-test-ptr-null.rs:10:13
1818
|
1919
LL | 0 => 42,
2020
| ^
2121

2222
error[E0080]: evaluation of constant value failed
23-
--> $DIR/match-test-ptr-null.rs:7:15
23+
--> $DIR/match-test-ptr-null.rs:6:15
2424
|
2525
LL | match &1 as *const i32 as usize {
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() {
22
let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants
3-
//~^ ERROR it is undefined behavior to use this value
3+
//~^ ERROR evaluation of constant value failed
44
}

src/test/ui/issues/issue-52023-array-size-pointer-cast.stderr

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ LL | let _ = [0; (&0 as *const i32) as usize];
77
= note: for more information, see https://github.com/rust-lang/rust/issues/51910
88
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
99

10-
error[E0080]: it is undefined behavior to use this value
10+
error[E0080]: evaluation of constant value failed
1111
--> $DIR/issue-52023-array-size-pointer-cast.rs:2:17
1212
|
1313
LL | let _ = [0; (&0 as *const i32) as usize];
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
15-
|
16-
= 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
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants
1715

1816
error: aborting due to 2 previous errors
1917

0 commit comments

Comments
 (0)