Skip to content

Stablize const_extern_fn for "Rust" and "C" - #95346

Merged
bors merged 1 commit into
rust-lang:masterfrom
Aaron1011:stablize-const-extern-fn
Apr 17, 2022
Merged

Stablize const_extern_fn for "Rust" and "C"#95346
bors merged 1 commit into
rust-lang:masterfrom
Aaron1011:stablize-const-extern-fn

Conversation

@Aaron1011

Copy link
Copy Markdown
Contributor

All other ABIs are left unstable for now.

cc #64926

All other ABIs are left unstable for now.
cc rust-lang#64926
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @michaelwoerister

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbotrustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 26, 2022
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 26, 2022
@michaelwoerister

Copy link
Copy Markdown
Member

I don't think I have the necessary context here. r? @pnkfelix

@pnkfelix

Copy link
Copy Markdown
Contributor

based on #64926 (comment) and #64926 (comment), this is fine.

@bors r+ rollup

@bors

bors commented Apr 14, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 8035796 has been approved by pnkfelix

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 14, 2022
@ehuss

Copy link
Copy Markdown
Contributor

Would you be willing to update the documentation here to note the changes here?

fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Apr 15, 2022
… r=pnkfelix
Stablize `const_extern_fn` for "Rust" and "C"
All other ABIs are left unstable for now.
cc rust-lang#64926
@fee1-deadfee1-dead mentioned this pull request Apr 15, 2022
@Dylan-DPCDylan-DPC mentioned this pull request Apr 15, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 15, 2022
… r=pnkfelix
Stablize `const_extern_fn` for "Rust" and "C"
All other ABIs are left unstable for now.
cc rust-lang#64926
RalfJung added a commit to RalfJung/rust that referenced this pull request Apr 15, 2022
… r=pnkfelix
Stablize `const_extern_fn` for "Rust" and "C"
All other ABIs are left unstable for now.
cc rust-lang#64926
@RalfJungRalfJung mentioned this pull request Apr 15, 2022
RalfJung added a commit to RalfJung/rust that referenced this pull request Apr 15, 2022
… r=pnkfelix
Stablize `const_extern_fn` for "Rust" and "C"
All other ABIs are left unstable for now.
cc rust-lang#64926
@RalfJungRalfJung mentioned this pull request Apr 15, 2022
RalfJung added a commit to RalfJung/rust that referenced this pull request Apr 15, 2022
… r=pnkfelix
Stablize `const_extern_fn` for "Rust" and "C"
All other ABIs are left unstable for now.
cc rust-lang#64926
@RalfJungRalfJung mentioned this pull request Apr 15, 2022
@Dylan-DPCDylan-DPC mentioned this pull request Apr 16, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 17, 2022
Rollup of 6 pull requests
Successful merges:
- rust-lang#95346 (Stablize `const_extern_fn` for "Rust" and "C")
- rust-lang#95933 (htmldocck: Compare HTML tree instead of plain text html)
- rust-lang#96105 (Make the debug output for `TargetSelection` less verbose)
- rust-lang#96112 (Strict provenance lint diagnostics improvements)
- rust-lang#96119 (update Miri)
- rust-lang#96124 (to_digit tweak)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit bd33498 into rust-lang:masterApr 17, 2022
@rustbotrustbot added this to the 1.62.0 milestone Apr 17, 2022
Aaron1011 added a commit to Aaron1011/libc that referenced this pull request May 10, 2022
This was recently stabilized in rust-lang/rust#95346,
and will be included in the 1.62.0 release.
This `const-extern-fn` feature can still be used to enable
these definitions on older compiler versions.
bors added a commit to rust-lang/libc that referenced this pull request Jun 9, 2022
Enable `libc_const_extern_fn` implicitly from Rust 1.62
const_extern_fn for "C" has been stabilized since 1.62: rust-lang/rust#95346
This enables the const-extern-fn feature implicitly from 1.62, but leaves the crate feature as-is for compatibility and old nightlies.
Closes#2785
@Mark-SimulacrumMark-Simulacrum added the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 9, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 9, 2022
…acrum
Add `const_extern_fn` to 1.62 release notes.
Adds rust-lang#95346 which did not get tagged with relnotes.
Closesrust-lang#101443
@folkertdevfolkertdev mentioned this pull request Aug 29, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2024
…, r=RalfJung
stabilize `const_extern_fn`
closesrust-lang#64926
tracking issue: rust-lang#64926
reference PR: rust-lang/reference#1596
## Stabilizaton Report
### Summary
Using `const extern "Rust"` and `const extern "C"` was already stabilized (since version 1.62.0, see rust-lang#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`
github-actionsBot pushed a commit to rust-lang/miri that referenced this pull request Sep 16, 2024
stabilize `const_extern_fn`
closesrust-lang/rust#64926
tracking issue: rust-lang/rust#64926
reference PR: rust-lang/reference#1596
## Stabilizaton Report
### Summary
Using `const extern "Rust"` and `const extern "C"` was already stabilized (since version 1.62.0, see rust-lang/rust#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`
Kobzol pushed a commit to Kobzol/portable-simd that referenced this pull request Feb 3, 2026
stabilize `const_extern_fn`
closesrust-lang/rust#64926
tracking issue: rust-lang/rust#64926
reference PR: rust-lang/reference#1596
## Stabilizaton Report
### Summary
Using `const extern "Rust"` and `const extern "C"` was already stabilized (since version 1.62.0, see rust-lang/rust#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`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotesMarks issues that should be documented in the release notes of the next release.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@Aaron1011@rust-highfive@michaelwoerister@pnkfelix@bors@ehuss@Mark-Simulacrum@rustbot