rust/compiler/rustc_span/src
Ralf Jung 85a59d40f1
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
2020-09-28 18:39:44 +02:00
..
analyze_source_file
source_map
symbol
analyze_source_file.rs
caching_source_map_view.rs
def_id.rs
edition.rs
fatal_error.rs
hygiene.rs Rollup merge of #77263 - bugadani:cleanup, r=lcnr 2020-09-27 18:37:29 +02:00
lib.rs /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
source_map.rs
span_encoding.rs
symbol.rs Remove rustc_allow_const_fn_ptr 2020-09-27 10:46:41 -07:00
tests.rs