See unstable-book: lang_items:
The first of these functions, rust_eh_personality
, is used by the failure mechanisms of the compiler. This is often mapped to GCC's personality function (see the libstd implementation for more information), but crates which do not trigger a panic can be assured that this function is never called. The language item's name is eh_personality
.
As far as I can tell it is required to create unwind information; if you abort or loop in the panic_fmt
language item (function rust_begin_unwind
) it probably doesn't get called.
Also see the internal comments in libpanic_abort/lib.rs.
If you search for rust_eh_personality
you'll find a usage in librustc_trans/context.rs: CodegenCx::eh_personality
. Searching for eh_personality
should reveal the places this function is called. (It is used for code generation, not a direct call.)
Searching for #[lang = "eh_personality"]
only shows the places where a personality is defined, not the usage.