Skip to content

Commit 7ff6f3c

Browse files
committed
reword ABI string category; make explicit that runtimes don't affect each other except at ABI boundary
1 parent e6e709d commit 7ff6f3c

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/items/functions.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,15 @@ behavior when unwinding out of a function.
214214

215215
The table below indicates the behavior of an unwinding operation reaching each
216216
type of ABI boundary (function declaration or definition using the
217-
corresponding ABI string). Additionally, `C` in the ABI strings may be
218-
substituted with `stdcall` or any other ABI (other than `Rust`)
219-
supported by the language implementation.
217+
corresponding ABI string). Note that the Rust runtime is not affected by, and
218+
cannot have an effect on, any unwinding that occurs entirely within another
219+
language's runtime, that is, unwinds that are thrown and caught without
220+
reaching a Rust ABI boundary.
221+
222+
The "unwinding" ABI category refers to `"Rust"` (the implicit ABI of Rust
223+
functions not marked `extern`), `"C-unwind"`, and any other ABI with `-unwind`
224+
in its name. The "non-unwinding" ABI category refers to all other ABI strings,
225+
including `"C"` and `"stdcall"`.
220226

221227
Native unwinding is defined per-target. On targets that support throwing and
222228
catching C++ exceptions, it refers to the mechanism used to implement this
@@ -225,12 +231,12 @@ unwinding"][forced-unwinding]; `longjmp` on Windows and `pthread_exit` in
225231
`glibc` are implemented this way. Forced unwinding is explicitly excluded
226232
from the "Native unwind" column in the table.
227233

228-
| panic runtime | ABI | `panic`-unwind | Native unwind (unforced) |
229-
| -------------- | ------------ | ------------------------------------- | ----------------------- |
230-
| `panic=unwind` | `"C-unwind"` | unwind | unwind |
231-
| `panic=unwind` | `"C"` | abort | [Undefined Behavior] |
232-
| `panic=abort` | `"C-unwind"` | `panic!` aborts (no unwinding occurs) | abort |
233-
| `panic=abort` | `"C"` | `panic!` aborts (no unwinding occurs) | [Undefined Behavior] |
234+
| panic runtime | ABI | `panic`-unwind | Native unwind (unforced) |
235+
| -------------- | ------------ | ------------------------------------- | ----------------------- |
236+
| `panic=unwind` | unwinding | unwind | unwind |
237+
| `panic=unwind` | non-unwinding | abort | [Undefined Behavior] |
238+
| `panic=abort` | unwinding | `panic!` aborts (no unwinding occurs) | abort |
239+
| `panic=abort` | non-unwinding | `panic!` aborts (no unwinding occurs) | [Undefined Behavior] |
234240

235241
[panic-modes]: ../panic.md#panic-runtimes
236242
[forced-unwinding]: https://rust-lang.github.io/rfcs/2945-c-unwind-abi.html#forced-unwinding

0 commit comments

Comments
 (0)