Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix for nightly 2018-07-10 #296

Merged
merged 4 commits into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
8 changes: 7 additions & 1 deletion polkadot/parachain/test-chains/basic_add/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions polkadot/parachain/test-chains/basic_add/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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();
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions substrate/runtime-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(lang_items))]
#![cfg_attr(not(feature = "std"), feature(panic_implementation))]
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), feature(core_intrinsics))]
#![cfg_attr(not(feature = "std"), feature(alloc))]

Expand Down
4 changes: 2 additions & 2 deletions substrate/runtime-io/without_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub fn panic(info: &::core::panic::PanicInfo) -> ! {
}
}

#[lang = "oom"]
pub extern fn oom() -> ! {
#[alloc_error_handler]
pub extern fn oom(_: ::core::alloc::Layout) -> ! {
static OOM_MSG: &str = "Runtime memory exhausted. Aborting";

unsafe {
Expand Down
1 change: 0 additions & 1 deletion substrate/runtime/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ pub trait Trait: Eq + Clone {
type Header: Parameter + traits::Header<
Number = Self::BlockNumber,
Hash = Self::Hash,
Hash = Self::Hash,
Digest = Self::Digest
>;
}
Expand Down
Binary file not shown.
Binary file not shown.