sccommunity / crates-sgx

crates-sgx is a monorepo of all Rust crates ported for Teaclave SGX SDK targeting Intel SGX.
https://sccommunity.github.io/crates-sgx
Apache License 2.0
12 stars 2 forks source link

Add thiserror 1.0.14 #10

Closed mssun closed 4 years ago

mssun commented 4 years ago

Add thiserror 1.0.14

Description

Add thiserror 1.0.14

Crate Meta

Diff of Changes

diff --git a/Cargo.toml b/Cargo.toml
index 558623e..d62b0ab 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,17 +13,22 @@ readme = "README.md"
 [badges]
 travis-ci = { repository = "dtolnay/thiserror" }

+[features]
+default = ["mesalock_sgx"]
+mesalock_sgx = ["sgx_tstd"]
+
 [dependencies]
 thiserror-impl = { version = "=1.0.14", path = "impl" }
+sgx_tstd = { git = "https://github.com/apache/incubator-teaclave-sgx-sdk", tag = "v1.1.1", optional = true }

 [dev-dependencies]
-anyhow = "1.0"
-ref-cast = "1.0"
-rustversion = "1.0"
-trybuild = { version = "1.0.19", features = ["diff"] }
+# anyhow = "1.0"
+# ref-cast = "1.0"
+# rustversion = "1.0"
+# trybuild = { version = "1.0.19", features = ["diff"] }

-[workspace]
-members = ["impl"]
+# [workspace]
+# members = ["impl"]

 [package.metadata.docs.rs]
 targets = ["x86_64-unknown-linux-gnu"]
diff --git a/src/lib.rs b/src/lib.rs
index 4a60a52..8a67513 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -176,6 +176,13 @@
 //!
 //!   [`anyhow`]: https://github.com/dtolnay/anyhow

+#![cfg_attr(all(feature = "mesalock_sgx",
+                not(target_env = "sgx")), no_std)]
+#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))]
+
+#[cfg(all(feature = "mesalock_sgx", not(target_env = "sgx")))]
+extern crate sgx_tstd as std;
+
 mod aserror;
 mod display;