aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Clément Tosi <ptosi@google.com>2022-11-28 11:51:32 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-11-28 11:51:32 +0000
commit1ec5c26be0d4a1336e7ecd95ae888e9c32528fe6 (patch)
tree94b0b9e937fc6fe363cbf7147ae86d656cc6dd3a
parent9f286aaa507fdb58e04f3bbd4d7eaea5e4ee3ca7 (diff)
parentdaecbc2192cd23153a6094c2b41aa21a82c07735 (diff)
downloadtinyvec-1ec5c26be0d4a1336e7ecd95ae888e9c32528fe6.tar.gz
Enable upstream feature 'std' am: 7388ef0146 am: daecbc2192
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/2318989 Change-Id: I7ec42d48a4e7e8d9db99374911185361a0ed6e99 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Android.bp33
-rw-r--r--cargo2android.json2
-rw-r--r--patches/std.diff14
-rw-r--r--src/lib.rs3
4 files changed, 26 insertions, 26 deletions
diff --git a/Android.bp b/Android.bp
index 3888f8c..3f35105 100644
--- a/Android.bp
+++ b/Android.bp
@@ -50,6 +50,7 @@ rust_library {
features: [
"alloc",
"default",
+ "std",
"tinyvec_macros",
],
rustlibs: [
@@ -62,22 +63,18 @@ rust_library {
min_sdk_version: "29",
}
-rust_test {
- name: "tinyvec_test_tests_arrayvec",
- host_supported: true,
- crate_name: "arrayvec",
+rust_defaults {
+ name: "tinyvec_test_defaults",
+ crate_name: "tinyvec",
cargo_env_compat: true,
cargo_pkg_version: "1.5.1",
- srcs: ["tests/arrayvec.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
- test_options: {
- unit_test: true,
- },
edition: "2018",
features: [
"alloc",
"default",
+ "std",
"tinyvec_macros",
],
rustlibs: [
@@ -88,3 +85,23 @@ rust_test {
"libtinyvec_macros",
],
}
+
+rust_test {
+ name: "tinyvec_test_tests_arrayvec",
+ defaults: ["tinyvec_test_defaults"],
+ host_supported: true,
+ srcs: ["tests/arrayvec.rs"],
+ test_options: {
+ unit_test: true,
+ },
+}
+
+rust_test {
+ name: "tinyvec_test_tests_tinyvec",
+ defaults: ["tinyvec_test_defaults"],
+ host_supported: true,
+ srcs: ["tests/tinyvec.rs"],
+ test_options: {
+ unit_test: true,
+ },
+}
diff --git a/cargo2android.json b/cargo2android.json
index 5974d19..a94ae9e 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -5,7 +5,7 @@
],
"dependencies": true,
"device": true,
- "features": "alloc,default,tinyvec_macros",
+ "features": "alloc,default,std,tinyvec_macros",
"min-sdk-version": "29",
"run": true,
"tests": true
diff --git a/patches/std.diff b/patches/std.diff
deleted file mode 100644
index 36d5c7d..0000000
--- a/patches/std.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/src/lib.rs b/src/lib.rs
-index c26f0c5..ce06601 100644
---- a/src/lib.rs
-+++ b/src/lib.rs
-@@ -66,6 +66,9 @@
- //! the `Array` trait. The actual usage of the crate is not expected to break
- //! significantly in this transition.
-
-+// ANDROID: Unconditionally use std to allow building as a dylib.
-+extern crate std;
-+
- #[allow(unused_imports)]
- use core::{
- borrow::{Borrow, BorrowMut},
diff --git a/src/lib.rs b/src/lib.rs
index c66705d..87d96bb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -62,9 +62,6 @@
//! the `Array` trait. The actual usage of the crate is not expected to break
//! significantly in this transition.
-// ANDROID: Unconditionally use std to allow building as a dylib.
-extern crate std;
-
#[allow(unused_imports)]
use core::{
borrow::{Borrow, BorrowMut},