-
Notifications
You must be signed in to change notification settings - Fork 594
add extern "custom"
#2300
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
base: master
Are you sure you want to change the base?
add extern "custom"
#2300
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Somewhere in the reference it would probably be good to clarify the purpose of parameters and return types in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We actually disallow them entirely |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,6 +239,15 @@ With `panic=unwind`, when a `panic` is turned into an abort by a non-unwinding A | |
|
|
||
| For other considerations and limitations regarding unwinding across FFI boundaries, see the [relevant section in the Panic documentation][panic-ffi]. | ||
|
|
||
| r[items.fn.extern.custom] | ||
| An `extern "custom"` function has an unknown, custom ABI. The only way to call such a function is via [inline assembly]. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a usage hint:
|
||
|
|
||
| r[items.fn.extern.custom.safety] | ||
| An `extern "custom"` function must be `unsafe`. | ||
|
|
||
| r[items.fn.extern.custom.naked] | ||
| An `extern "custom"` function definition must be a [naked function]. | ||
|
|
||
| [forced-unwinding]: https://rust-lang.github.io/rfcs/2945-c-unwind-abi.html#forced-unwinding | ||
| [panic handler]: ../panic.md#the-panic_handler-attribute | ||
| [panic-ffi]: ../panic.md#unwinding-across-ffi-boundaries | ||
|
|
@@ -411,6 +420,7 @@ fn foo_oof(#[some_inert_attribute] arg: u8) { | |
| [testing attributes]: ../attributes/testing.md | ||
| [`cold`]: ../attributes/codegen.md#the-cold-attribute | ||
| [`inline`]: ../attributes/codegen.md#the-inline-attribute | ||
| [naked function]: ../attributes/codegen.md#the-naked-attribute | ||
| [`deprecated`]: ../attributes/diagnostics.md#the-deprecated-attribute | ||
| [`doc`]: ../../rustdoc/the-doc-attribute.html | ||
| [`must_use`]: ../attributes/diagnostics.md#the-must_use-attribute | ||
|
|
@@ -427,3 +437,4 @@ fn foo_oof(#[some_inert_attribute] arg: u8) { | |
| [variadic function]: external-blocks.md#variadic-functions | ||
| [`extern` block]: external-blocks.md | ||
| [zero-sized]: glossary.zst | ||
| [inline assembly]: ../inline-assembly.md | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be good to have an example at
src/inline-assembly.mdalongside naked functions?View changes since the review