@@ -174,12 +174,15 @@ extern "C" fn new_i32() -> i32 { 0 }
174
174
let fptr : extern " C" fn () -> i32 = new_i32 ;
175
175
```
176
176
177
- Functions with an ABI that differs from ` "Rust" ` do not support unwinding in the
178
- exact same way that Rust does. Therefore, unwinding past the end of functions
179
- with such ABIs causes the process to abort.
177
+ Functions with an ABI that differs from ` "Rust" ` do not support unwinding in
178
+ the exact same way that Rust does. Therefore, unwinding past the end of
179
+ functions with such ABIs results in undefined behavior, and will differ between
180
+ platforms and compiler editions. If you cannot guarantee this will not happen,
181
+ you should use [ ` catch_unwind ` ] or similar to abort the program instead if
182
+ unwinding would pass through the function.
180
183
181
- > ** Note** : The LLVM backend of the ` rustc ` implementation
182
- aborts the process by executing an illegal instruction.
184
+ > ** Note** : Currently, in nightly ` rustc ` the LLVM backend aborts the process
185
+ > by executing an illegal instruction. However, this is not the behavior in stable .
183
186
184
187
## Const functions
185
188
@@ -372,3 +375,4 @@ fn foo_oof(#[some_inert_attribute] arg: u8) {
372
375
[ `link_section` ] : ../abi.md#the-link_section-attribute
373
376
[ `no_mangle` ] : ../abi.md#the-no_mangle-attribute
374
377
[ built-in attributes ] : ../attributes.html#built-in-attributes-index
378
+ [ `catch_unwind` ] : ../../std/panic/fn.catch_unwind.html
0 commit comments