Rollup merge of #77170 - ecstatic-morse:const-fn-ptr, r=oli-obk
Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]` `rustc_allow_const_fn_ptr` was a hack to work around the lack of an escape hatch for the "min `const fn`" checks in const-stable functions. Now that we have co-opted `allow_internal_unstable` for this purpose, we no longer need a bespoke attribute. Now this functionality is gated under `const_fn_fn_ptr_basics` (how concise!), and `#[allow_internal_unstable(const_fn_fn_ptr_basics)]` replaces `#[rustc_allow_const_fn_ptr]`. `const_fn_fn_ptr_basics` allows function pointer types to appear in the arguments and locals of a `const fn` as well as function pointer casts to be performed inside a `const fn`. Both of these were allowed in constants and statics already. Notably, this does **not** allow users to invoke function pointers in a const context. Presumably, we will use a nicer name for that (`const_fn_ptr`?). r? @oli-obk
This commit is contained in:
commit
85a59d40f1
39 changed files with 146 additions and 135 deletions
|
@ -239,6 +239,7 @@
|
|||
#![cfg_attr(not(bootstrap), feature(const_fn_floating_point_arithmetic))]
|
||||
#![feature(const_fn_transmute)]
|
||||
#![feature(const_fn)]
|
||||
#![cfg_attr(not(bootstrap), feature(const_fn_fn_ptr_basics))]
|
||||
#![feature(const_ip)]
|
||||
#![feature(const_ipv6)]
|
||||
#![feature(const_raw_ptr_deref)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue