Skip to content

Commit

Permalink
Add compile errors when built with unsupported wasm features
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Sep 29, 2024
1 parent 28d059f commit 74e2da3
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions soroban-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,11 @@
#[cfg(all(target_family = "wasm", feature = "testutils"))]
compile_error!("'testutils' feature is not supported on 'wasm' target");

#[cfg(all(
target_family = "wasm",
any(target_feature = "reference-types", target_feature = "multivalue")
))]
compile_!(
"Compiler configuration is unsupported by Soroban Environment, because a
Wasm feature is enabled that is not yet supported: reference-types,
multivalue. Use Rust 1.81 or older, or disable reference-types or
multivalue."
);
#[cfg(all(target_family = "wasm", target_feature = "reference-types",))]
compile_error!("Compiler configuration is unsupported by Soroban Environment, because a Wasm target-feature is enabled that is not yet supported: reference-types. Use Rust 1.81 or older.");

#[cfg(all(target_family = "wasm", target_feature = "multivalue",))]
compile_error!("Compiler configuration is unsupported by Soroban Environment, because a Wasm target-feature is enabled that is not yet supported: multivalue. Use Rust 1.81 or older.");

// When used in a no_std contract, provide a panic handler as one is required.
#[cfg(all(not(feature = "alloc"), target_family = "wasm"))]
Expand Down

0 comments on commit 74e2da3

Please sign in to comment.