Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 1 commit into from
Apr 17, 2022

Conversation

Aaron1011
Copy link
Member

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
Collaborator

r? @michaelwoerister

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

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

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

@pnkfelix
Copy link
Member

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

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 14, 2022

📌 Commit 8035796 has been approved by pnkfelix

@bors bors 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
Contributor

ehuss commented Apr 15, 2022

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
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
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
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
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:master Apr 17, 2022
@rustbot rustbot 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-Simulacrum Mark-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.

Closes rust-lang#101443
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2024
…, r=RalfJung

stabilize `const_extern_fn`

closes rust-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-actions bot pushed a commit to rust-lang/miri that referenced this pull request Sep 16, 2024
stabilize `const_extern_fn`

closes rust-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`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant 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