@@ -59,34 +59,12 @@ pub mod _migrating;
5959compile_error ! ( "'testutils' feature is not supported on 'wasm' target" ) ;
6060
6161// When used in a no_std contract, provide a panic handler as one is required.
62- #[ cfg( all ( not ( feature = "alloc" ) , target_family = "wasm" ) ) ]
62+ #[ cfg( target_family = "wasm" ) ]
6363#[ panic_handler]
6464fn handle_panic ( _: & core:: panic:: PanicInfo ) -> ! {
6565 core:: arch:: wasm32:: unreachable ( )
6666}
6767
68- // This is a bit subtle: we want to provide a narrowly-scoped feature `"alloc"`
69- // that provides support for the `alloc` crate and its types, while using our
70- // allocator (defined below in module `alloc`). We want to do this without
71- // changing the user-interface a lot (in particular keeping users writing
72- // `#[no_std]` and mostly not-using the stdlib casually, because it has many
73- // components that produce large code footprint).
74- //
75- // This is _almost_ possible without involving `std` but unfortunately there's
76- // still an allocation-error handler (`alloc_error_handler`) that there's no
77- // stable way to install if one only uses the `alloc` crate, so we pull in a
78- // dependency on `std` here (for now). When the stabilization of the allocation
79- // error handler registration function happens in some future Rust version, or
80- // it gets removed which it looks like work is heading towards instead, we can
81- // remove std.
82- //
83- // See these issues for more details:
84- // - https://github.com/rust-lang/rust/issues/51540
85- // - https://github.com/rust-lang/rust/issues/66740
86- // - https://github.com/rust-lang/rust/issues/66741
87- #[ cfg( all( feature = "alloc" , target_family = "wasm" ) ) ]
88- extern crate std;
89-
9068// Here we provide a `#[global_allocator]` that is a minimal non-freeing bump
9169// allocator, appropriate for a WASM blob that runs a single contract call.
9270#[ cfg( all( feature = "alloc" , target_family = "wasm" ) ) ]
0 commit comments