Skip to content
New issue

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

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

Already on GitHub? # to your account

Add no-panic-handler feature #2164

Merged
merged 2 commits into from
Mar 18, 2024
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
3 changes: 3 additions & 0 deletions crates/env/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ ink-debug = []

# Disable the ink! provided global memory allocator.
no-allocator = [ "ink_allocator/no-allocator" ]

# Disable the ink! provided panic handler.
no-panic-handler = []
2 changes: 1 addition & 1 deletion crates/env/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub const BUFFER_SIZE: usize = 16384;
#[allow(unused_extern_crates)]
extern crate rlibc;

#[cfg(not(feature = "std"))]
#[cfg(not(any(feature = "std", feature = "no-panic-handler")))]
#[allow(unused_variables)]
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
Expand Down
3 changes: 3 additions & 0 deletions crates/ink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ show-codegen-docs = []

# Disable the ink! provided global memory allocator.
no-allocator = [ "ink_env/no-allocator" ]

# Disable the ink! provided panic handler.
no-panic-handler = ["ink_env/no-panic-handler"]