aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-11-29 05:49:57 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-11-29 05:49:57 +0000
commit93350e0ddd4a68858978bce0be40a920233f4ed9 (patch)
tree94b0b9e937fc6fe363cbf7147ae86d656cc6dd3a
parent55e2ba7b9d74c7b801880474d8911bfb57fc5add (diff)
parent0a329ea608b741ad2a979548b27d5c38ba7b287e (diff)
downloadtinyvec-93350e0ddd4a68858978bce0be40a920233f4ed9.tar.gz
Snap for 9344284 from 0a329ea608b741ad2a979548b27d5c38ba7b287e to udc-d1-release
Change-Id: I98063b8e178fcea8bb3995ba867194f1c63317a5
-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},