Upgrade rust/crates/idna to 0.2.3 am: 0582a09a9f

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/idna/+/1712593

Change-Id: Ifc382b42eb5e2329ae86c54508cc1db90d23bdba
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 9926491..0eb4358 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
 {
   "git": {
-    "sha1": "5e929762c9319f4f5b8d0311c920a9069d3d2e10"
+    "sha1": "837538c549f3458f157ee154ae76e3e2b9e27118"
   }
 }
diff --git a/Cargo.toml b/Cargo.toml
index 5666892..138a271 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
 [package]
 edition = "2018"
 name = "idna"
-version = "0.2.2"
+version = "0.2.3"
 authors = ["The rust-url developers"]
 autotests = false
 description = "IDNA (Internationalizing Domain Names in Applications) and Punycode."
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 8aba16d..6b3750b 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
 [package]
 name = "idna"
-version = "0.2.2"
+version = "0.2.3"
 authors = ["The rust-url developers"]
 description = "IDNA (Internationalizing Domain Names in Applications) and Punycode."
 repository = "https://github.com/servo/rust-url/"
diff --git a/METADATA b/METADATA
index b73f242..265ca62 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/idna/idna-0.2.2.crate"
+    value: "https://static.crates.io/crates/idna/idna-0.2.3.crate"
   }
-  version: "0.2.2"
+  version: "0.2.3"
   license_type: NOTICE
   last_upgrade_date {
     year: 2021
-    month: 4
-    day: 1
+    month: 5
+    day: 19
   }
 }
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 5da7ae4..be39865 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,16 +2,19 @@
 {
   "presubmit": [
     {
-      "name": "url_device_test_tests_unit"
+      "name": "doh_unit_test"
     },
     {
-      "name": "url_device_test_tests_data"
+      "name": "quiche_device_test_src_lib"
     },
     {
       "name": "url_device_test_src_lib"
     },
     {
-      "name": "quiche_device_test_src_lib"
+      "name": "url_device_test_tests_data"
+    },
+    {
+      "name": "url_device_test_tests_unit"
     }
   ]
 }
diff --git a/src/punycode.rs b/src/punycode.rs
index a237504..21955f3 100644
--- a/src/punycode.rs
+++ b/src/punycode.rs
@@ -78,6 +78,10 @@
             ),
         };
 
+        if !base.is_ascii() {
+            return Err(());
+        }
+
         let base_len = base.len();
         let mut length = base_len as u32;
         let mut code_point = INITIAL_N;
diff --git a/src/uts46.rs b/src/uts46.rs
index 0b7d27a..ad79805 100644
--- a/src/uts46.rs
+++ b/src/uts46.rs
@@ -309,7 +309,6 @@
         _ => true,
     }) {
         errors.invalid_mapping = true;
-        return;
     }
 
     // V7: ContextJ rules
diff --git a/tests/unit.rs b/tests/unit.rs
index 84a9d54..297c8cf 100644
--- a/tests/unit.rs
+++ b/tests/unit.rs
@@ -131,3 +131,9 @@
     let error = format!("{:?}", config.to_ascii("☕.com").unwrap_err());
     assert!(error.contains("disallowed_in_idna_2008"));
 }
+
+#[test]
+fn unicode_before_delimiter() {
+    let config = idna::Config::default();
+    assert!(config.to_ascii("xn--f\u{34a}-PTP").is_err());
+}