Skip to content

Commit

Permalink
Add no-panic-handler feature (#2164)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascjones authored Mar 18, 2024
1 parent 0e84193 commit 72a671c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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"]

0 comments on commit 72a671c

Please sign in to comment.