about summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2019-05-09 23:01:39 +0100
committerMatthew Jasper <mjjasper1@gmail.com>2019-06-13 21:05:21 +0100
commitda22793a35b725e2fe2f7e2ac1d808404c39c4aa (patch)
treec48a0a97a0308968e92ebfcc68b5e314c8d3e758 /src/test/ui/consts/const-eval
parent32c337724dd3a1b651cb7ba9769e60262f9f52f8 (diff)
downloadrust-da22793a35b725e2fe2f7e2ac1d808404c39c4aa.tar.gz
rust-da22793a35b725e2fe2f7e2ac1d808404c39c4aa.zip
Create fewer basic blocks in match MIR lowering
Diffstat (limited to 'src/test/ui/consts/const-eval')
-rw-r--r--src/test/ui/consts/const-eval/match-test-ptr-null.rs1
-rw-r--r--src/test/ui/consts/const-eval/match-test-ptr-null.stderr12
2 files changed, 10 insertions, 3 deletions
diff --git a/src/test/ui/consts/const-eval/match-test-ptr-null.rs b/src/test/ui/consts/const-eval/match-test-ptr-null.rs
index e0af01aeef4..50757afaf56 100644
--- a/src/test/ui/consts/const-eval/match-test-ptr-null.rs
+++ b/src/test/ui/consts/const-eval/match-test-ptr-null.rs
@@ -6,6 +6,7 @@ fn main() {
         match &1 as *const i32 as usize {
             //~^ ERROR casting pointers to integers in constants
             //~| NOTE for more information, see
+            //~| ERROR constant contains unimplemented expression type
             0 => 42, //~ ERROR constant contains unimplemented expression type
             //~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed
             //~| ERROR evaluation of constant value failed
diff --git a/src/test/ui/consts/const-eval/match-test-ptr-null.stderr b/src/test/ui/consts/const-eval/match-test-ptr-null.stderr
index d005e09b28a..167d5ad8d61 100644
--- a/src/test/ui/consts/const-eval/match-test-ptr-null.stderr
+++ b/src/test/ui/consts/const-eval/match-test-ptr-null.stderr
@@ -8,18 +8,24 @@ LL |         match &1 as *const i32 as usize {
    = 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:9:13
+  --> $DIR/match-test-ptr-null.rs:6:15
+   |
+LL |         match &1 as *const i32 as usize {
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0019]: constant contains unimplemented expression type
+  --> $DIR/match-test-ptr-null.rs:10:13
    |
 LL |             0 => 42,
    |             ^
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/match-test-ptr-null.rs:9:13
+  --> $DIR/match-test-ptr-null.rs:10:13
    |
 LL |             0 => 42,
    |             ^ "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
 
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
 
 Some errors have detailed explanations: E0019, E0080, E0658.
 For more information about an error, try `rustc --explain E0019`.