2 ms·
'lang item' does roughly mean symbol, but they have their own Rust syntax to communicate their existence to the compiler. Lang items are special functions / typ
by brson 11y ago
'lang item' does roughly mean symbol, but they have their own Rust syntax to communicate their existence to the compiler. Lang items are special functions / types that can only be defined once globally, must be defined for certain features to work. They are how the standard library hooks into the Rust language for a variety of purposes, and to a large extent what makes it possible for Rust to define much of its functionality in libraries instead of in the language.
The two lang items that are absolutely required but not defined in core are 'eh_personality' and 'panic_fmt'. Read more here: http://doc.rust-lang.org/nightly/book/no-stdlib.html http://doc.rust-lang.org/nightly/book/no-stdlib.html