Skip to content

Commit c49c7f3

Browse files
authored
remove panic handlers (#377)
1 parent 5e14313 commit c49c7f3

File tree

15 files changed

+14
-26
lines changed

15 files changed

+14
-26
lines changed

.github/workflows/check-wasm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
target: wasm32-unknown-unknown
2727
components: rust-src
28-
toolchain: nightly-2024-01-01
28+
toolchain: nightly-2024-07-25
2929

3030
- uses: Swatinem/rust-cache@v2
3131

.github/workflows/e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
target: wasm32-unknown-unknown
3434
components: rust-src
35-
toolchain: nightly-2024-01-01
35+
toolchain: nightly-2024-07-25
3636

3737
- uses: Swatinem/rust-cache@v2
3838
with:

.github/workflows/gas-bench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
target: wasm32-unknown-unknown
2727
components: rust-src
28-
toolchain: nightly-2024-01-01
28+
toolchain: nightly-2024-07-25
2929

3030
- uses: Swatinem/rust-cache@v2
3131
with:

contracts/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rand.workspace = true
3131
std = []
3232

3333
[lib]
34-
crate-type = ["lib", "cdylib"]
34+
crate-type = ["lib"]
3535

3636
[lints]
3737
workspace = true

contracts/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,3 @@ extern crate alloc;
4747
pub mod access;
4848
pub mod token;
4949
pub mod utils;
50-
51-
#[cfg(all(target_arch = "wasm32", not(feature = "std")))]
52-
#[panic_handler]
53-
fn panic(_info: &core::panic::PanicInfo) -> ! {
54-
loop {}
55-
}

examples/access-control/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_std, no_main)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloc::vec::Vec;

examples/basic/token/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_main, no_std)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloc::vec::Vec;

examples/ecdsa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_std, no_main)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloc::vec::Vec;

examples/erc20-permit/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_main, no_std)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloc::vec::Vec;

examples/erc20/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_main, no_std)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloc::vec::Vec;

examples/erc721-consecutive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_main, no_std)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloy_primitives::{Address, U256};

examples/erc721-metadata/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_main, no_std)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloc::{string::String, vec::Vec};

examples/erc721/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_main, no_std)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloc::vec::Vec;

examples/merkle-proofs/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(feature = "std"), no_std, no_main)]
1+
#![cfg_attr(not(feature = "std"), no_main)]
22
extern crate alloc;
33

44
use alloc::vec::Vec;
@@ -14,12 +14,6 @@ use stylus_sdk::{
1414
prelude::{entrypoint, public, sol_storage},
1515
};
1616

17-
#[cfg(target_arch = "wasm32")]
18-
#[panic_handler]
19-
fn panic(_info: &core::panic::PanicInfo) -> ! {
20-
loop {}
21-
}
22-
2317
sol! {
2418
error MerkleProofInvalidMultiProofLength();
2519
error MerkleProofInvalidRootChild();

examples/ownable/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(test), no_std, no_main)]
1+
#![cfg_attr(not(test), no_main)]
22
extern crate alloc;
33

44
use alloc::vec::Vec;

0 commit comments

Comments
 (0)