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

Document that Option<extern "abi" fn> discriminant elision applies for any ABI #95083

Merged
merged 1 commit into from
Mar 19, 2022

Conversation

danielhenrymantilla
Copy link
Contributor

@danielhenrymantilla danielhenrymantilla commented Mar 18, 2022

The current phrasing was not very clear on that aspect.

r? @RalfJung

@rustbot modify labels: A-docs A-ffi

…for any ABI

The current phrasing was not very clear on that aspect.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 18, 2022
@rustbot rustbot added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-FFI Area: Foreign function interface (FFI) labels Mar 18, 2022
@RalfJung
Copy link
Member

I am not sure why it specifically says C, is it possible that this was intentional?

@RalfJung
Copy link
Member

RalfJung commented Mar 18, 2022

Cc @rust-lang/lang

@nikomatsakis
Copy link
Contributor

Hm, I can't really imagine why -- it seems like a property of the architecture if anything whether null is a valid function pointer, not the ABI.

@RalfJung
Copy link
Member

Looking back at this comment indeed it seems the intention was to cover all ABIs. The PR originally just mentioned extern "C" fn and then fn got added upon my request.

Niko also wrote

As far as ABI, we're not aware of any ABIs for which this property doesn't hold, and if a new ABI were added in the future, we could exempt it if necessary.

So, based on that:
@bors r+

I am curious how/whether that footnote will render in rustdoc...

@bors
Copy link
Contributor

bors commented Mar 18, 2022

📌 Commit 156734d has been approved by RalfJung

@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 Mar 18, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 18, 2022
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#94115 (Let `try_collect` take advantage of `try_fold` overrides)
 - rust-lang#94295 (Always evaluate all cfg predicate in all() and any())
 - rust-lang#94848 (Compare installed browser-ui-test version to the one used in CI)
 - rust-lang#94993 (Add test for >65535 hashes in lexing raw string)
 - rust-lang#95017 (Derive Eq for std::cmp::Ordering, instead of using manual impl.)
 - rust-lang#95058 (Add use of bool::then in sys/unix/process)
 - rust-lang#95083 (Document that `Option<extern "abi" fn>` discriminant elision applies for any ABI)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@danielhenrymantilla
Copy link
Contributor Author

I am curious how/whether that footnote will render in rustdoc...

See https://doc.rust-lang.org/nightly/std/pin/macro.pin.html#fn1 for an example

@bors bors merged commit 9c40db2 into rust-lang:master Mar 19, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-FFI Area: Foreign function interface (FFI) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants