Fix up patches so we can migrate.

Once we migrate and update to a new version, we can probably get rid of
lint-rename.patch and unexpected-cfgs.diff. See aosp/1662921 and https://github.com/briansmith/untrusted/commit/f934f697ff75c10ab3691ed591d1d93a3de3580f

Bug: http://b/339424309
Test: treehugger
Change-Id: If719759c6b7ed429899848a47f73242e48a3e30c
diff --git a/Cargo.toml b/Cargo.toml
index 9da787a..9214798 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,3 +27,6 @@
 [lib]
 name = "untrusted"
 path = "src/untrusted.rs"
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(android_dylib)'] }
diff --git a/patches/allow-lint.patch b/patches/allow-lint.patch
new file mode 100644
index 0000000..6b46302
--- /dev/null
+++ b/patches/allow-lint.patch
@@ -0,0 +1,14 @@
+diff --git b/src/untrusted.rs a/src/untrusted.rs
+index 657634a..47c281e 100644
+--- b/src/untrusted.rs
++++ a/src/untrusted.rs
+@@ -100,6 +100,9 @@
+     variant_size_differences,
+     warnings
+ )]
++// ANDROID: This lint is included in warnings and thus forbidden, but this version of the library
++// is not compatible with it.
++#![allow(rustdoc::bare_urls)]
+ #![no_std]
+ 
+ // ANDROID: use std to allow building as a dylib.
diff --git a/patches/lint-rename.patch b/patches/lint-rename.patch
deleted file mode 100644
index d28acc7..0000000
--- a/patches/lint-rename.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 6f300ba0a9bc047c08c1bc63bdb831d56479815b Mon Sep 17 00:00:00 2001
-From: Chris Wailes <[email protected]>
-Date: Fri, 10 Feb 2023 12:12:30 -0800
-Subject: [PATCH] Update crate source to work with Rust 1.66.1
-
-This CL changes the name of a lint in an annotation to allow rustdoc to
-successfully process the crate.
-
-Test: RUST_PREBUILT_VERSION="1.66.1" m rustdoc
-Bug: 263153841
-Change-Id: If213ca89d296bb06d3bdeadb18b2c5b31ff36a2a
----
- src/untrusted.rs | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/untrusted.rs b/src/untrusted.rs
-index a9d7f7b..5071fdd 100644
---- a/src/untrusted.rs
-+++ b/src/untrusted.rs
-@@ -102,7 +102,7 @@
- )]
- // ANDROID: This lint is included in warnings and thus forbidden, but this version of the library
- // is not compatible with it.
--#![allow(non_autolinks)]
-+#![allow(rustdoc::bare_urls)]
- #![no_std]
- 
- // ANDROID: Unconditionally use std to allow building as a dylib.
--- 
-2.39.1.581.gbfd45094c4-goog
-
diff --git a/patches/std.diff b/patches/std.diff
index 9d110cc..e567718 100644
--- a/patches/std.diff
+++ b/patches/std.diff
@@ -1,9 +1,9 @@
-diff --git a/src/untrusted.rs b/src/untrusted.rs
-index 2f88bb4..b9f1439 100644
---- a/src/untrusted.rs
-+++ b/src/untrusted.rs
-@@ -102,6 +102,9 @@
- )]
+diff --git b/src/untrusted.rs a/src/untrusted.rs
+index 010b001..47c281e 100644
+--- b/src/untrusted.rs
++++ a/src/untrusted.rs
+@@ -105,6 +105,10 @@
+ #![allow(rustdoc::bare_urls)]
  #![no_std]
  
 +// ANDROID: use std to allow building as a dylib.
diff --git a/patches/unexpected-cfgs.diff b/patches/unexpected-cfgs.diff
new file mode 100644
index 0000000..eb0e55b
--- /dev/null
+++ b/patches/unexpected-cfgs.diff
@@ -0,0 +1,11 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index 9da787a..9214798 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -27,3 +27,6 @@ lto = true
+ [lib]
+ name = "untrusted"
+ path = "src/untrusted.rs"
++
++[lints.rust]
++unexpected_cfgs = { level = "warn", check-cfg = ['cfg(android_dylib)'] }