diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-06-23 00:33:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-23 00:33:54 -0700 |
| commit | ae38698e7fca180d612dc11be12023076e23236c (patch) | |
| tree | 0d6facabc6acf33196c2d87b81ff79035deffc32 /src/test/ui/error-codes | |
| parent | 903823c59bcb9890df2a6fadcf7aa22f74eed67f (diff) | |
| parent | e465b227d15fec8f16863ba8e77191ceb5c8670b (diff) | |
| download | rust-ae38698e7fca180d612dc11be12023076e23236c.tar.gz rust-ae38698e7fca180d612dc11be12023076e23236c.zip | |
Rollup merge of #73398 - oli-obk:const_raw_ptr_cmp, r=varkor,RalfJung,nagisa
A way forward for pointer equality in const eval r? @varkor on the first commit and @RalfJung on the second commit cc #53020
Diffstat (limited to 'src/test/ui/error-codes')
| -rw-r--r-- | src/test/ui/error-codes/E0395.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0395.stderr | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/test/ui/error-codes/E0395.rs b/src/test/ui/error-codes/E0395.rs index bbefff27d7f..d2edd97efb2 100644 --- a/src/test/ui/error-codes/E0395.rs +++ b/src/test/ui/error-codes/E0395.rs @@ -1,10 +1,8 @@ -// gate-test-const_compare_raw_pointers - static FOO: i32 = 42; static BAR: i32 = 42; static BAZ: bool = unsafe { (&FOO as *const i32) == (&BAR as *const i32) }; -//~^ ERROR comparing raw pointers inside static +//~^ ERROR pointers cannot be reliably compared during const eval fn main() { } diff --git a/src/test/ui/error-codes/E0395.stderr b/src/test/ui/error-codes/E0395.stderr index 20c8622f337..674cc696450 100644 --- a/src/test/ui/error-codes/E0395.stderr +++ b/src/test/ui/error-codes/E0395.stderr @@ -1,12 +1,10 @@ -error[E0658]: comparing raw pointers inside static - --> $DIR/E0395.rs:6:29 +error: pointers cannot be reliably compared during const eval. + --> $DIR/E0395.rs:4:29 | LL | static BAZ: bool = unsafe { (&FOO as *const i32) == (&BAR as *const i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #53020 <https://github.com/rust-lang/rust/issues/53020> for more information - = help: add `#![feature(const_compare_raw_pointers)]` to the crate attributes to enable error: aborting due to previous error -For more information about this error, try `rustc --explain E0658`. |
