Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rust-1.68): drop alloc error handler #2581

Closed
wants to merge 2 commits into from
Closed
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
805 changes: 444 additions & 361 deletions Cargo.lock

Large diffs are not rendered by default.

214 changes: 108 additions & 106 deletions Cargo.toml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion examples/binaries/async-tester/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};

Expand Down
1 change: 0 additions & 1 deletion examples/binaries/exit-handle-sender/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]

use codec::{Decode, Encode};
Expand Down
1 change: 0 additions & 1 deletion examples/binaries/exit-handle/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
Expand Down
1 change: 0 additions & 1 deletion examples/binaries/exit-init/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
Expand Down
1 change: 0 additions & 1 deletion examples/binaries/gas-burned/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
Expand Down
1 change: 0 additions & 1 deletion examples/binaries/init-fail-sender/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
Expand Down
1 change: 0 additions & 1 deletion examples/binaries/init-wait-reply-exit/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
Expand Down
1 change: 0 additions & 1 deletion examples/binaries/init-wait/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
Expand Down
1 change: 0 additions & 1 deletion examples/binaries/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), no_std)]

extern crate alloc;
Expand Down
7 changes: 0 additions & 7 deletions examples/ping/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![no_std]
#![feature(alloc_error_handler)]

#[cfg(target_arch = "wasm32")]
extern crate galloc;
Expand All @@ -20,12 +19,6 @@ extern "C" fn handle() {
}
}

#[cfg(target_arch = "wasm32")]
#[alloc_error_handler]
pub fn oom(_: core::alloc::Layout) -> ! {
core::arch::wasm32::unreachable()
}

#[cfg(target_arch = "wasm32")]
#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! {
Expand Down
1 change: 0 additions & 1 deletion gcli/res/messager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(feature = "std"), feature(const_btree_new))]
#![cfg_attr(not(feature = "std"), no_std)]

Expand Down
8 changes: 1 addition & 7 deletions gstd/src/common/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@
//! For `debug` mode it provides more extensive logging.

#[cfg(target_arch = "wasm32")]
use {crate::ext, core::alloc::Layout, core::panic::PanicInfo};

#[cfg(target_arch = "wasm32")]
#[alloc_error_handler]
pub fn oom(_: Layout) -> ! {
ext::oom_panic()
}
use {crate::ext, core::panic::PanicInfo};

#[cfg(not(feature = "debug"))]
#[cfg(not(debug_assertions))]
Expand Down
1 change: 0 additions & 1 deletion gstd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@
all(target_arch = "wasm32", any(feature = "debug", debug_assertions)),
feature(panic_info_message)
)]
#![cfg_attr(target_arch = "wasm32", feature(alloc_error_handler))]
#![cfg_attr(feature = "strict", deny(warnings))]
#![doc(html_logo_url = "https://docs.gear.rs/logo.svg")]

Expand Down