aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-08-17 22:34:20 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-08-17 22:34:20 +0000
commitdb127f1c99ea85560df7a2f56de4a7e8cafc2ade (patch)
tree03acdaa9caf61638ffb0a6fd48056fe94589f17c
parentf206a73d9ee444e00f97a82ab826279e227c246c (diff)
parent428668d23270a91e032ca395dffa5ae1024e105e (diff)
downloadx509-parser-db127f1c99ea85560df7a2f56de4a7e8cafc2ade.tar.gz
Use patch not feature to fix rustdoc build. am: a1302f7a8b am: c8bd0a0329 am: c240c7a5b0 am: 428668d232
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/x509-parser/+/1798347 Change-Id: Ia202fcabc1daba20bd9c08f2d5398cf39695f05f
-rw-r--r--Android.bp5
-rw-r--r--cargo2android.json1
-rw-r--r--patches/rustdoc.patch24
-rw-r--r--src/traits.rs13
4 files changed, 37 insertions, 6 deletions
diff --git a/Android.bp b/Android.bp
index 62fc34d..6d64e30 100644
--- a/Android.bp
+++ b/Android.bp
@@ -45,10 +45,7 @@ rust_library {
cargo_pkg_version: "0.10.0",
srcs: ["src/lib.rs"],
edition: "2018",
- features: [
- "default",
- "validate",
- ],
+ features: ["default"],
rustlibs: [
"libbase64_rust",
"libchrono",
diff --git a/cargo2android.json b/cargo2android.json
index e24b32a..5f001a6 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -3,7 +3,6 @@
"data_encoding"
],
"device": true,
- "features": "default,validate",
"run": true
}
diff --git a/patches/rustdoc.patch b/patches/rustdoc.patch
new file mode 100644
index 0000000..d6ec591
--- /dev/null
+++ b/patches/rustdoc.patch
@@ -0,0 +1,24 @@
+diff --git a/src/traits.rs b/src/traits.rs
+index bd4d070..aae96e5 100644
+--- a/src/traits.rs
++++ b/src/traits.rs
+@@ -5,7 +5,18 @@ use crate::error::X509Result;
+ ///
+ /// The returned object uses zero-copy, and so has the same lifetime as the input.
+ ///
+-/// Note that only parsing is done, not validation (see the [`Validate`](crate::validate::Validate) trait).
++#[cfg_attr(
++ feature = "validate",
++ doc = r#"
++Note that only parsing is done, not validation (see the [`Validate`](crate::validate::Validate) trait).
++"#
++)]
++#[cfg_attr(
++ not(feature = "validate"),
++ doc = r#"
++Note that only parsing is done, not validation.
++"#
++)]
+ ///
+ /// # Example
+ ///
diff --git a/src/traits.rs b/src/traits.rs
index bd4d070..aae96e5 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -5,7 +5,18 @@ use crate::error::X509Result;
///
/// The returned object uses zero-copy, and so has the same lifetime as the input.
///
-/// Note that only parsing is done, not validation (see the [`Validate`](crate::validate::Validate) trait).
+#[cfg_attr(
+ feature = "validate",
+ doc = r#"
+Note that only parsing is done, not validation (see the [`Validate`](crate::validate::Validate) trait).
+"#
+)]
+#[cfg_attr(
+ not(feature = "validate"),
+ doc = r#"
+Note that only parsing is done, not validation.
+"#
+)]
///
/// # Example
///