From 1fc7580a8e75020c486cd73ab3b149f0df2a6abd Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 17 Jul 2018 13:46:48 +0200 Subject: [PATCH] Rebase fallout: new tests need updated ui output --- src/test/ui/const-eval/match-test-ptr-null.rs | 2 +- src/test/ui/const-eval/match-test-ptr-null.stderr | 12 +++++++----- src/test/ui/issue-17458.stderr | 6 ++++-- src/test/ui/issue-18294.stderr | 8 +++++--- src/test/ui/issue-52023-array-size-pointer-cast.rs | 2 +- .../ui/issue-52023-array-size-pointer-cast.stderr | 8 +++++--- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/test/ui/const-eval/match-test-ptr-null.rs b/src/test/ui/const-eval/match-test-ptr-null.rs index 19b3dcc3181..81fcd23fb78 100644 --- a/src/test/ui/const-eval/match-test-ptr-null.rs +++ b/src/test/ui/const-eval/match-test-ptr-null.rs @@ -13,7 +13,7 @@ fn main() { // that pointer comparison is disallowed, not that parts of a pointer are accessed as raw // bytes. let _: [u8; 0] = [4; { //~ ERROR could not evaluate repeat length - match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers + match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants 0 => 42, //~ ERROR constant contains unimplemented expression type //~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed n => n, diff --git a/src/test/ui/const-eval/match-test-ptr-null.stderr b/src/test/ui/const-eval/match-test-ptr-null.stderr index 726ada9b428..26577948fae 100644 --- a/src/test/ui/const-eval/match-test-ptr-null.stderr +++ b/src/test/ui/const-eval/match-test-ptr-null.stderr @@ -1,8 +1,10 @@ -error[E0018]: raw pointers cannot be cast to integers in constants +error[E0658]: casting pointers to integers in constants is unstable (see issue #51910) --> $DIR/match-test-ptr-null.rs:16:15 | -LL | match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers +LL | match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable error[E0019]: constant contains unimplemented expression type --> $DIR/match-test-ptr-null.rs:17:13 @@ -15,7 +17,7 @@ error[E0080]: could not evaluate repeat length | LL | let _: [u8; 0] = [4; { //~ ERROR could not evaluate repeat length | __________________________^ -LL | | match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers +LL | | match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants LL | | 0 => 42, //~ ERROR constant contains unimplemented expression type | | - "pointer arithmetic or comparison" needs an rfc before being allowed inside constants LL | | //~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed @@ -26,5 +28,5 @@ LL | | }]; error: aborting due to 3 previous errors -Some errors occurred: E0018, E0019, E0080. -For more information about an error, try `rustc --explain E0018`. +Some errors occurred: E0019, E0080, E0658. +For more information about an error, try `rustc --explain E0019`. diff --git a/src/test/ui/issue-17458.stderr b/src/test/ui/issue-17458.stderr index 7a43813fa6d..0303e4bddb5 100644 --- a/src/test/ui/issue-17458.stderr +++ b/src/test/ui/issue-17458.stderr @@ -1,9 +1,11 @@ -error[E0018]: raw pointers cannot be cast to integers in statics +error[E0658]: casting pointers to integers in statics is unstable (see issue #51910) --> $DIR/issue-17458.rs:11:19 | LL | static X: usize = 0 as *const usize as usize; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable error: aborting due to previous error -For more information about this error, try `rustc --explain E0018`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issue-18294.stderr b/src/test/ui/issue-18294.stderr index 151deefb2b7..0b94e778d37 100644 --- a/src/test/ui/issue-18294.stderr +++ b/src/test/ui/issue-18294.stderr @@ -1,9 +1,11 @@ -error[E0018]: raw pointers cannot be cast to integers in constants +error[E0658]: casting pointers to integers in constants is unstable (see issue #51910) --> $DIR/issue-18294.rs:13:22 | -LL | const Y: usize = &X as *const u32 as usize; //~ ERROR E0018 +LL | const Y: usize = &X as *const u32 as usize; //~ ERROR is unstable | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable error: aborting due to previous error -For more information about this error, try `rustc --explain E0018`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issue-52023-array-size-pointer-cast.rs b/src/test/ui/issue-52023-array-size-pointer-cast.rs index f3bee1a6315..02bed69f0d4 100644 --- a/src/test/ui/issue-52023-array-size-pointer-cast.rs +++ b/src/test/ui/issue-52023-array-size-pointer-cast.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - let _ = [0; (&0 as *const i32) as usize]; //~ ERROR raw pointers cannot be cast + let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants } diff --git a/src/test/ui/issue-52023-array-size-pointer-cast.stderr b/src/test/ui/issue-52023-array-size-pointer-cast.stderr index 888de82e379..74270c2bef7 100644 --- a/src/test/ui/issue-52023-array-size-pointer-cast.stderr +++ b/src/test/ui/issue-52023-array-size-pointer-cast.stderr @@ -1,9 +1,11 @@ -error[E0018]: raw pointers cannot be cast to integers in constants +error[E0658]: casting pointers to integers in constants is unstable (see issue #51910) --> $DIR/issue-52023-array-size-pointer-cast.rs:12:17 | -LL | let _ = [0; (&0 as *const i32) as usize]; //~ ERROR raw pointers cannot be cast +LL | let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable error: aborting due to previous error -For more information about this error, try `rustc --explain E0018`. +For more information about this error, try `rustc --explain E0658`. -- 2.44.0