Add a few stubs required from std into the library

This commit is contained in:
Dylan McKay 2017-09-23 17:09:24 +12:00
parent 1888fa52d3
commit 5d65ad4efd
2 changed files with 21 additions and 0 deletions

View File

@ -3,6 +3,9 @@
#![feature(asm)] #![feature(asm)]
#![feature(no_core)] #![feature(no_core)]
#![feature(const_fn)] #![feature(const_fn)]
#![feature(associated_consts)]
#![feature(lang_items)]
#![feature(unwind_attributes)]
#![no_core] #![no_core]
@ -23,6 +26,8 @@ pub mod spi;
mod register; mod register;
mod pin; mod pin;
mod usart; mod usart;
#[doc(hidden)]
pub mod std_stub;
pub enum DataDirection { pub enum DataDirection {
Input, Input,

16
src/std_stub.rs Normal file
View File

@ -0,0 +1,16 @@
//! Stub methods that `libstd` normally defines.
// These do not need to be in a module, but we group them here for clarity.
pub mod std {
#[lang = "eh_personality"]
#[no_mangle]
pub unsafe extern "C" fn rust_eh_personality(_state: (), _exception_object: *mut (), _context: *mut ()) -> () {
}
#[lang = "panic_fmt"]
#[unwind]
pub extern fn rust_begin_panic(_msg: (), _file: &'static str, _line: u32) -> ! {
loop { }
}
}