aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergii Parubochyi <sergiip@google.com>2023-10-24 08:25:16 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-10-24 08:25:16 +0000
commit3462f0b7047b1629f17a05e8ce5a97c78f2696a5 (patch)
treee4b39e013ea4fafe1f20308134f2fb6e4bb7ee24
parentbc9dc6a310975d1d5386d229bd63a1496cc88685 (diff)
parent8892fec2cdc9e09795522ba1c007fa78b12f881c (diff)
downloaduntrusted-3462f0b7047b1629f17a05e8ce5a97c78f2696a5.tar.gz
Add condition for using std only for dylib am: 8892fec2cd
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/untrusted/+/2797575 Change-Id: I41563e872813125ccde2a4f90a9acd720991f7c6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--patches/std.diff3
-rw-r--r--src/untrusted.rs3
2 files changed, 4 insertions, 2 deletions
diff --git a/patches/std.diff b/patches/std.diff
index e3ebe5e..9d110cc 100644
--- a/patches/std.diff
+++ b/patches/std.diff
@@ -6,7 +6,8 @@ index 2f88bb4..b9f1439 100644
)]
#![no_std]
-+// ANDROID: Unconditionally use std to allow building as a dylib.
++// ANDROID: use std to allow building as a dylib.
++#[cfg(android_dylib)]
+extern crate std;
+
/// A wrapper around `&'a [u8]` that helps in writing panic-free code.
diff --git a/src/untrusted.rs b/src/untrusted.rs
index 5071fdd..47c281e 100644
--- a/src/untrusted.rs
+++ b/src/untrusted.rs
@@ -105,7 +105,8 @@
#![allow(rustdoc::bare_urls)]
#![no_std]
-// ANDROID: Unconditionally use std to allow building as a dylib.
+// ANDROID: use std to allow building as a dylib.
+#[cfg(android_dylib)]
extern crate std;
/// A wrapper around `&'a [u8]` that helps in writing panic-free code.