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`
This commit is contained in:
commit
cd53b4dba5
5 changed files with 16 additions and 20 deletions
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue