Rollup merge of #26761 - steveklabnik:actually_ub, r=alexcrichton

I incorrectly stated that it's an abort.

r? @Gankro
This commit is contained in:
Steve Klabnik 2015-07-06 18:06:29 -04:00
commit aef38ef819

View File

@ -533,19 +533,10 @@ attribute turns off Rust's name mangling, so that it is easier to link to.
# FFI and panics
Its important to be mindful of `panic!`s when working with FFI. This code,
when called from C, will `abort`:
```rust
#[no_mangle]
pub extern fn oh_no() -> ! {
panic!("Oops!");
}
# fn main() {}
```
If youre writing code that may panic, you should run it in another thread,
so that the panic doesnt bubble up to C:
Its important to be mindful of `panic!`s when working with FFI. A `panic!`
across an FFI boundary is undefined behavior. If youre writing code that may
panic, you should run it in another thread, so that the panic doesnt bubble up
to C:
```rust
use std::thread;