Closed
Description
I’m playing with making a bare-metal executable in rust. I fully admit to not knowing what I’m doing, but I thought this was worth reporting given that it resulted in a stack overflow in rustc. This was produced with the rust nightly from 2014/1/10. I’m on OS X 10.10.1 and installed rustc from the OS X .pkg flle.
Here’s how I invoked the compiler:
$ rustc spin.rs
spin.rs:4:1: 4:19 warning: use of unstable item, #[warn(unstable)] on by default
spin.rs:4 extern crate core;
^~~~~~~~~~~~~~~~~~
thread 'rustc' has overflowed its stack
Illegal instruction: 4
Here’s spin.rs:
#![feature(lang_items)]
#![no_std]
extern crate core;
use core::fmt::Arguments;
#[lang="stack_exhausted"]
extern fn stack_exhausted() {}
#[lang="eh_personality"]
extern fn eh_personality() {}
#[lang="begin_unwind"]
extern fn begin_unwind() {}
#[lang="panic_fmt"]
pub fn panic_fmt(_fmt: &Arguments, _file_line: &(&'static str, usize)) -> ! {
loop { }
}
#[lang="start"]
fn main() {
loop {
}
}