You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by rd...@apache.org on 2021/04/01 05:24:03 UTC

[incubator-teaclave-sgx-sdk] branch newer-compiler-03-30 updated: Add sgx_tstd::prelude::{rust_2015, rust_2018, rust_2010}

This is an automated email from the ASF dual-hosted git repository.

rduan pushed a commit to branch newer-compiler-03-30
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git


The following commit(s) were added to refs/heads/newer-compiler-03-30 by this push:
     new e8fa0d3  Add sgx_tstd::prelude::{rust_2015,rust_2018,rust_2010}
e8fa0d3 is described below

commit e8fa0d31f7751d7379d7dab9cbec450636b52614
Author: volcano <vo...@163.com>
AuthorDate: Thu Apr 1 13:23:02 2021 +0800

    Add sgx_tstd::prelude::{rust_2015,rust_2018,rust_2010}
---
 sgx_tstd/build.rs           |  6 ++++++
 sgx_tstd/src/lib.rs         |  1 +
 sgx_tstd/src/prelude/mod.rs | 30 ++++++++++++++++++++++++++++++
 xargo/sgx_tstd/build.rs     |  6 ++++++
 4 files changed, 43 insertions(+)

diff --git a/sgx_tstd/build.rs b/sgx_tstd/build.rs
index ddc7ab9..2dc2664 100644
--- a/sgx_tstd/build.rs
+++ b/sgx_tstd/build.rs
@@ -51,6 +51,12 @@ fn main() {
     if let Some(true) = is_min_date("2021-02-07") {
         println!("cargo:rustc-cfg=derive_macros");
     }
+
+    // nightly-2021-03-11 (rustc 2021-03-10)
+    // https://github.com/rust-lang/rust/commit/1ab9fe5d44860050232438967bbbf9bdc35dbde1
+    if let Some(true) = is_min_date("2021-03-10") {
+        println!("cargo:rustc-cfg=enable_prelude_version");
+    }
 }
 
 // code below copied from crate version_check
diff --git a/sgx_tstd/src/lib.rs b/sgx_tstd/src/lib.rs
index 44db0f9..856b5ce 100644
--- a/sgx_tstd/src/lib.rs
+++ b/sgx_tstd/src/lib.rs
@@ -81,6 +81,7 @@
 #![feature(needs_panic_runtime)]
 #![feature(once_cell)]
 #![feature(panic_unwind)]
+#![cfg_attr(enable_prelude_version, feature(prelude_2021))]
 #![feature(prelude_import)]
 #![feature(ptr_internals)]
 #![feature(raw)]
diff --git a/sgx_tstd/src/prelude/mod.rs b/sgx_tstd/src/prelude/mod.rs
index ff66b28..cb8353f 100644
--- a/sgx_tstd/src/prelude/mod.rs
+++ b/sgx_tstd/src/prelude/mod.rs
@@ -30,3 +30,33 @@
 //! On a technical level, Rust inserts
 //!
 pub mod v1;
+
+/// The 2015 version of the prelude of The Rust Standard Library.
+///
+/// See the [module-level documentation](self) for more.
+#[cfg(enable_prelude_version)]
+pub mod rust_2015 {
+    #[doc(no_inline)]
+    pub use super::v1::*;
+}
+
+/// The 2018 version of the prelude of The Rust Standard Library.
+///
+/// See the [module-level documentation](self) for more.
+#[cfg(enable_prelude_version)]
+pub mod rust_2018 {
+    #[doc(no_inline)]
+    pub use super::v1::*;
+}
+
+/// The 2021 version of the prelude of The Rust Standard Library.
+///
+/// See the [module-level documentation](self) for more.
+#[cfg(enable_prelude_version)]
+pub mod rust_2021 {
+    #[doc(no_inline)]
+    pub use super::v1::*;
+
+    #[doc(no_inline)]
+    pub use core::prelude::rust_2021::*;
+}
diff --git a/xargo/sgx_tstd/build.rs b/xargo/sgx_tstd/build.rs
index 8d99763..a3ef7e2 100644
--- a/xargo/sgx_tstd/build.rs
+++ b/xargo/sgx_tstd/build.rs
@@ -52,6 +52,12 @@ fn main() {
     if let Some(true) = is_min_date("2021-02-07") {
         println!("cargo:rustc-cfg=derive_macros");
     }
+
+    // nightly-2021-03-11 (rustc 2021-03-10)
+    // https://github.com/rust-lang/rust/commit/1ab9fe5d44860050232438967bbbf9bdc35dbde1
+    if let Some(true) = is_min_date("2021-03-10") {
+        println!("cargo:rustc-cfg=enable_prelude_version");
+    }
 }
 
 // code below copied from crate version_check

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org