Skip to content

Commit

Permalink
Add compiler error if unsupported target-features are in use
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Sep 27, 2024
1 parent abbba12 commit 28d059f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions soroban-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@
#[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."
);

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

0 comments on commit 28d059f

Please sign in to comment.