Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Provide fnptr impls for extern "system" #96513

Closed
wants to merge 2 commits into from
Closed

Conversation

CAD97
Copy link
Contributor

@CAD97 CAD97 commented Apr 28, 2022

extern "system" is a cross-platform ABI. Adding these impls means that we provide the fnptr impls for all cross-platform ABIs.

A perfect solution would be to have the compiler provide these implementations, so that they're available for all ABIs and all airities, not just arities up to 12. Until we have that perfect shiny future, there's imho three defensible positions to take:

  • Provide impls for just extern "Rust" and extern "C" — status quo
  • Provide impls for all cross-platform ABIs — this PR
  • Provide impls for all ABIs, including platform-specific — assumed intractable

The downside of providing more impls is that the fn primitive documentation gets more crowded with more implementations. I think the benefit outweighs the downside here, especially since the trait implementations on that page are already effectively unusable.

(Side note: stable 1.60 only provides one Debug link in the sidebar, whereas beta 1.61 has one for each impl. This is the case for any impl which isn't parameterized.)

@rust-highfive
Copy link
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs to request review from a libs-api team reviewer. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Apr 28, 2022
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 28, 2022
@CAD97
Copy link
Contributor Author

CAD97 commented Apr 28, 2022

r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Apr 28, 2022
@rustbot rustbot removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Apr 28, 2022
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented May 18, 2022

☔ The latest upstream changes (presumably #97135) made this pull request unmergeable. Please resolve the merge conflicts.

@RalfJung
Copy link
Member

RalfJung commented Jun 1, 2022

The downside of providing more impls is that the fn primitive documentation gets more crowded with more implementations. I think the benefit outweighs the downside here, especially since the trait implementations on that page are already effectively unusable.

doc(hidden) on all instances except extern "Rust" fn could potentially be used to prevent that page from blowing up?

@RalfJung
Copy link
Member

RalfJung commented Jun 1, 2022

This overlaps with #92964.

@CAD97
Copy link
Contributor Author

CAD97 commented Jun 3, 2022

I wasn't aware of #92964 when I made this PR; I'll close in favor of that one (or the referenced trait solution).

@CAD97 CAD97 closed this Jun 3, 2022
@CAD97 CAD97 deleted the patch-3 branch June 3, 2022 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API 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