From 28d059f0792258e1bd6c7d52c66078844e2d2067 Mon Sep 17 00:00:00 2001
From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Date: Sat, 28 Sep 2024 09:58:00 +1000
Subject: [PATCH 1/4] Add compiler error if unsupported target-features are in
 use

---
 soroban-sdk/src/lib.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/soroban-sdk/src/lib.rs b/soroban-sdk/src/lib.rs
index a4b8aa5cb..ed0fc0ded 100644
--- a/soroban-sdk/src/lib.rs
+++ b/soroban-sdk/src/lib.rs
@@ -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]

From 74e2da30314f599bda4b7af4ddbdf7c88147eb24 Mon Sep 17 00:00:00 2001
From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Date: Mon, 30 Sep 2024 08:31:20 +1000
Subject: [PATCH 2/4] Add compile errors when built with unsupported wasm
 features

---
 soroban-sdk/src/lib.rs | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/soroban-sdk/src/lib.rs b/soroban-sdk/src/lib.rs
index ed0fc0ded..cffa18d79 100644
--- a/soroban-sdk/src/lib.rs
+++ b/soroban-sdk/src/lib.rs
@@ -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"))]

From d463e0f28919237a5f46f6cca8d0d4ccf2d3c332 Mon Sep 17 00:00:00 2001
From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Date: Mon, 30 Sep 2024 08:42:50 +1000
Subject: [PATCH 3/4] tweak

---
 soroban-sdk/src/lib.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/soroban-sdk/src/lib.rs b/soroban-sdk/src/lib.rs
index 01b1564c7..5bb504d6d 100644
--- a/soroban-sdk/src/lib.rs
+++ b/soroban-sdk/src/lib.rs
@@ -48,10 +48,10 @@
 compile_error!("'testutils' feature is not supported on 'wasm' target");
 
 #[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.");
+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 to get a compatible default configuration.");
 
 #[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.");
+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 to get a compatible default configuration.");
 
 // When used in a no_std contract, provide a panic handler as one is required.
 #[cfg(all(not(feature = "alloc"), target_family = "wasm"))]

From a7e91851cf4cfb124b0a57e933ad29f0277c40a8 Mon Sep 17 00:00:00 2001
From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Date: Mon, 30 Sep 2024 08:56:50 +1000
Subject: [PATCH 4/4] tweak

---
 soroban-sdk/src/lib.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/soroban-sdk/src/lib.rs b/soroban-sdk/src/lib.rs
index 5bb504d6d..0a3d43874 100644
--- a/soroban-sdk/src/lib.rs
+++ b/soroban-sdk/src/lib.rs
@@ -47,10 +47,10 @@
 #[cfg(all(target_family = "wasm", feature = "testutils"))]
 compile_error!("'testutils' feature is not supported on 'wasm' target");
 
-#[cfg(all(target_family = "wasm", target_feature = "reference-types",))]
+#[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 to get a compatible default configuration.");
 
-#[cfg(all(target_family = "wasm", target_feature = "multivalue",))]
+#[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 to get a compatible default configuration.");
 
 // When used in a no_std contract, provide a panic handler as one is required.