Fix for nightly 2018-07-10 (#296)

* Use [alloc_error_handler] instead of oom lang item

* Same fix for basic_add

* Drive by fix for duplicate generic parameter

* Rebuild binaries.
This commit is contained in:
Sergey Pepyakin
2018-07-11 16:40:33 +03:00
committed by Gav Wood
parent b239fe0acc
commit 042ded7cc5
4 changed files with 10 additions and 4 deletions
@@ -17,7 +17,13 @@
//! Basic parachain that adds a number as part of its state.
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc, core_intrinsics, lang_items, panic_implementation, core_panic_info))]
#![cfg_attr(
not(feature = "std"),
feature(
alloc, core_intrinsics, lang_items, panic_implementation, core_panic_info,
alloc_error_handler
)
)]
#[cfg(not(feature = "std"))]
extern crate alloc;
@@ -16,7 +16,7 @@
//! Defines WASM module logic.
use core::{intrinsics, panic};
use core::{intrinsics, panic, alloc};
use parachain::{self, ValidationResult};
use parachain::codec::Slicable;
use super::{HeadData, BlockData};
@@ -29,9 +29,9 @@ pub fn panic(_info: &panic::PanicInfo) -> ! {
}
}
#[lang = "oom"]
#[alloc_error_handler]
#[no_mangle]
pub fn oom() -> ! {
pub fn oom(_: alloc::Layout) -> ! {
unsafe {
intrinsics::abort();
}