> Specifically, there are two 'weak lang items' that need to be defined. Lang items are not yet stable.
What two specific items? By "lang item" here, do you mean roughly "symbol", or something else entirely?
What two specific items? By "lang item" here, do you mean roughly "symbol", or something else entirely?
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
$ cargo new example --bin
$ cd example
$ cat > src/main.rs
#![no_std]
fn main() {}
^D
$ multirust run stable cargo run
Compiling example v0.1.0 (file:///home/steve/tmp/example)
error: language item required, but not found: `panic_fmt`
error: language item required, but not found: `eh_personality`
error: aborting due to 2 previous errors
Could not compile `example`.
In general a "lang item" is some portion of Rust that the language expects to be defined in some manner. They must all be defined for compiling to work. `libcore` defines many of these language items, but does not for these last two. `libstd` does.You can provide your own:
#[lang = "eh_personality"]
extern "C" fn eh_personality() {
}
#[lang = "panic_fmt"]
fn panic_fmt() -> ! {
loop {}
}
These are enough to get going, but actually using `#[lang]` requires a `#![feature]`, which requires nightly.You also end up needing #[start], which is also behind a feature gate. The documentation brson linked you to contains an example no_std executable.