diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-08-29 21:12:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-29 21:12:57 +0200 |
| commit | cd53b4dba535f1fa5ded91595d8aacaf3aef075d (patch) | |
| tree | 737a8317acab5baf07c89c3d1b7c18094ca1c9eb /src | |
| parent | ecd908ac5e0f91923f4b0915a7ac04d7909d6e8e (diff) | |
| parent | f29c3c421b9fd2afb52062590c5f2e052f8d3815 (diff) | |
| download | rust-cd53b4dba535f1fa5ded91595d8aacaf3aef075d.tar.gz rust-cd53b4dba535f1fa5ded91595d8aacaf3aef075d.zip | |
Rollup merge of #101131 - RalfJung:ctfe-no-needs-rfc, r=oli-obk
CTFE: exposing pointers and calling extern fn is just impossible The remaining "needs RFC" errors are just needlessly confusing, I think -- time to get rid of that error variant. They are anyway only reachable with miri-unleashed (if at all). r? `@oli-obk`
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/consts/miri_unleashed/ptr_arith.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/consts/miri_unleashed/ptr_arith.stderr | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/test/ui/consts/miri_unleashed/ptr_arith.rs b/src/test/ui/consts/miri_unleashed/ptr_arith.rs index 13e6af36e02..6a19b294585 100644 --- a/src/test/ui/consts/miri_unleashed/ptr_arith.rs +++ b/src/test/ui/consts/miri_unleashed/ptr_arith.rs @@ -8,7 +8,7 @@ static PTR_INT_CAST: () = { let x = &0 as *const _ as usize; //~^ ERROR could not evaluate static initializer - //~| "exposing pointers" needs an rfc before being allowed inside constants + //~| exposing pointers let _v = x == x; }; @@ -19,4 +19,7 @@ static PTR_INT_TRANSMUTE: () = unsafe { //~| unable to turn pointer into raw bytes }; +// I'd love to test pointer comparison, but that is not possible since +// their `PartialEq` impl is non-`const`. + fn main() {} diff --git a/src/test/ui/consts/miri_unleashed/ptr_arith.stderr b/src/test/ui/consts/miri_unleashed/ptr_arith.stderr index 00cff23fb3f..f5c5ee2b8eb 100644 --- a/src/test/ui/consts/miri_unleashed/ptr_arith.stderr +++ b/src/test/ui/consts/miri_unleashed/ptr_arith.stderr @@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer --> $DIR/ptr_arith.rs:9:13 | LL | let x = &0 as *const _ as usize; - | ^^^^^^^^^^^^^^^^^^^^^^^ "exposing pointers" needs an rfc before being allowed inside constants + | ^^^^^^^^^^^^^^^^^^^^^^^ exposing pointers is not possible at compile-time error[E0080]: could not evaluate static initializer --> $DIR/ptr_arith.rs:17:14 |
