Closed
Description
The following code makes rustc core dump. It is hardly a normal use case, but it would be nice if rustc failed more gracefully.
$ cat main.rs
#![no_std]
#![feature(box_syntax)]
#![feature(lang_items)]
extern crate core;
use core::ptr::Unique;
#[lang="owned_box"]
pub struct Box<T>(Unique<T>);
#[lang="start"]
fn main() {
let mut test:[isize;1] = [0;1];
let a = box 5;
test[*a] = 0;
}
#[lang = "stack_exhausted"] extern fn stack_exhausted() {}
#[lang = "eh_personality"] extern fn eh_personality() {}
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop{} }
$ rustc main.rs
main.rs:5:1: 5:19 warning: use of unstable item, #[warn(unstable)] on by default
main.rs:5 extern crate core;
^~~~~~~~~~~~~~~~~~
thread 'rustc' has overflowed its stack
Illegal instruction (core dumped)