Support building all variants.
Bug: 143217452
Test: cd external/rust; mma; atest in all TEST_MAPPING subdirs
Change-Id: I5211af1f6afb09a074d3507e29d6bbe756597998
diff --git a/Android.bp b/Android.bp
index ade0621..53312e8 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,8 +1,9 @@
// This file is generated by cargo2android.py.
-rust_library_host_rlib {
+rust_library {
name: "liblazycell",
crate_name: "lazycell",
+ host_supported: true,
srcs: ["src/lib.rs"],
edition: "2015",
}
diff --git a/src/lib.rs b/src/lib.rs
index f7f8488..e753ea8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -44,10 +44,9 @@
//! coordination in a thread-safe fashion. The limitation of an `AtomicLazyCell`
//! is that after it is initialized, it can't be modified.
-
-#[cfg(not(test))]
+// ANDROID: Unconditionally use std to allow building as a dylib.
#[macro_use]
-extern crate core as std;
+extern crate std;
use std::cell::UnsafeCell;
use std::mem;