Skip to content

Commit bd1829d

Browse files
authored
Merge pull request #396 from tmandry/patch-1
Copyedits to FFI and unwinding section
2 parents 7d56a22 + d1a59f5 commit bd1829d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/ffi.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -721,17 +721,20 @@ No `transmute` required!
721721
722722
## FFI and unwinding
723723
724-
It’s important to be mindful of unwinding when working with FFI. Each
725-
non-`Rust` ABI comes in two variants, one with `-unwind` suffix and one without. If
726-
you expect Rust `panic`s or foreign (e.g. C++) exceptions to cross an FFI
727-
boundary, that boundary must use the appropriate `-unwind` ABI string (note
728-
that compiling with `panic=abort` will still cause `panic!` to immediately
729-
abort the process, regardless of which ABI is specified by the function that
730-
`panic`s).
724+
It’s important to be mindful of unwinding when working with FFI. Most
725+
ABI strings come in two variants, one with an `-unwind` suffix and one without.
726+
The `Rust` ABI always permits unwinding, so there is no `Rust-unwind` ABI.
731727
728+
If you expect Rust `panic`s or foreign (e.g. C++) exceptions to cross an FFI
729+
boundary, that boundary must use the appropriate `-unwind` ABI string.
732730
Conversely, if you do not expect unwinding to cross an ABI boundary, use one of
733-
the non-`unwind` ABI strings (other than `Rust`, which always permits
734-
unwinding). If an unwinding operation does encounter an ABI boundary that is
731+
the non-`unwind` ABI strings.
732+
733+
> Note: Compiling with `panic=abort` will still cause `panic!` to immediately
734+
abort the process, regardless of which ABI is specified by the function that
735+
`panic`s.
736+
737+
If an unwinding operation does encounter an ABI boundary that is
735738
not permitted to unwind, the behavior depends on the source of the unwinding
736739
(Rust `panic` or a foreign exception):
737740

0 commit comments

Comments
 (0)