rust/compiler/rustc_parse/src/parser
bors 4f1be92153 Auto merge of #129753 - folkertdev:stabilize-const-extern-fn, r=RalfJung
stabilize `const_extern_fn`

closes https://github.com/rust-lang/rust/issues/64926

tracking issue: https://github.com/rust-lang/rust/issues/64926
reference PR: https://github.com/rust-lang/reference/pull/1596

## Stabilizaton Report

### Summary

Using `const extern "Rust"` and `const extern "C"` was already stabilized (since version 1.62.0, see https://github.com/rust-lang/rust/pull/95346). This PR stabilizes the other calling conventions: it is now possible to write  `const unsafe extern "calling-convention" fn` and `const extern "calling-convention" fn` for any supported calling convention:

```rust
const extern "C-unwind" fn foo1(val: u8) -> u8 { val + 1}
const extern "stdcall" fn foo2(val: u8) -> u8 { val + 1}
const unsafe extern "C-unwind" fn bar1(val: bool) -> bool { !val }
const unsafe extern "stdcall" fn bar2(val: bool) -> bool { !val }
```

This can be used to const-ify an `extern fn`, or conversely, to make a `const fn` callable from external code.

r? T-lang

cc `@RalfJung`
2024-09-14 23:47:59 +00:00
..
mut_visit Reformat use declarations. 2024-07-29 08:26:52 +10:00
tokenstream Reformat use declarations. 2024-07-29 08:26:52 +10:00
attr.rs Rollup merge of #128524 - chenyukang:yukang-fix-127930-invalid-outer-style-sugg, r=cjgillot 2024-08-24 21:03:31 -05:00
attr_wrapper.rs clippy::useless_conversion 2024-09-11 17:52:53 -04:00
diagnostics.rs Remove needless returns detected by clippy in the compiler 2024-09-09 13:32:22 +02:00
expr.rs Refactor Parser::break_up_float 2024-09-14 13:17:16 +02:00
generics.rs Overhaul token collection. 2024-08-16 09:07:55 +10:00
item.rs Rollup merge of #130250 - compiler-errors:useless-conversion, r=jieyouxu 2024-09-12 20:37:17 +10:00
mod.rs Also fix if in else 2024-09-11 17:24:01 -04:00
nonterminal.rs Add initial support for raw lifetimes 2024-09-06 10:32:48 -04:00
pat.rs Also fix if in else 2024-09-11 17:24:01 -04:00
path.rs Simplify some nested if statements 2024-09-11 13:45:23 -04:00
stmt.rs Rollup merge of #128524 - chenyukang:yukang-fix-127930-invalid-outer-style-sugg, r=cjgillot 2024-08-24 21:03:31 -05:00
tests.rs Use assert_matches around the compiler 2024-08-11 12:25:39 -04:00
ty.rs stabilize const_extern_fn 2024-09-14 18:07:06 +02:00