[core,alloc] Fix bug with global_allocator not being recognized

parent 9315cef3
......@@ -20,13 +20,10 @@
feature(core_intrinsics, alloc_error_handler,)
)]
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
mod handlers;
// Use `wee_alloc` as the global allocator.
#[cfg(not(feature = "std"))]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[cfg(not(feature = "std"))]
mod handlers;
......@@ -46,6 +46,11 @@
// unused_results,
)]
// This extern crate definition is required since otherwise rustc
// is not recognizing its allocator and panic handler definitions.
#[cfg(not(feature = "std"))]
extern crate ink_alloc;
#[cfg(not(feature = "std"))]
extern crate alloc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment