Upgrade rust/crates/bstr to 0.2.15 am: bd98581c57 am: ddc5b5e1cb am: 80b83d98ce

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

Change-Id: Iee6bed39cc4333e243dcbc0ed6546c50416f06a7
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 2ecf829..f1ec46c 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
 {
   "git": {
-    "sha1": "7f0ad15d9628c0abec8cf6b7585539cae63e6d5b"
+    "sha1": "a444256ca7407fe180ee32534688549655b7a38e"
   }
 }
diff --git a/Android.bp b/Android.bp
index f7dff1d..5bb6b68 100644
--- a/Android.bp
+++ b/Android.bp
@@ -60,7 +60,7 @@
 }
 
 // dependent_library ["feature_list"]
-//   byteorder-1.4.2
+//   byteorder-1.4.3
 //   lazy_static-1.4.0
 //   memchr-2.3.4 "std,use_std"
 //   regex-automata-0.1.9
diff --git a/Cargo.toml b/Cargo.toml
index b4215b4..f02d695 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@
 
 [package]
 name = "bstr"
-version = "0.2.14"
+version = "0.2.15"
 authors = ["Andrew Gallant <jamslam@gmail.com>"]
 exclude = ["/.github"]
 description = "A string type that is not required to be valid UTF-8."
@@ -46,7 +46,7 @@
 optional = true
 default-features = false
 [dev-dependencies.quickcheck]
-version = "0.8.1"
+version = "1"
 default-features = false
 
 [dev-dependencies.ucd-parse]
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 63388bc..585da1b 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
 [package]
 name = "bstr"
-version = "0.2.14"  #:version
+version = "0.2.15"  #:version
 authors = ["Andrew Gallant <jamslam@gmail.com>"]
 description = "A string type that is not required to be valid UTF-8."
 documentation = "https://docs.rs/bstr"
@@ -33,7 +33,7 @@
 serde = { version = "1.0.85", default-features = false, optional = true }
 
 [dev-dependencies]
-quickcheck = { version = "0.8.1", default-features = false }
+quickcheck = { version = "1", default-features = false }
 ucd-parse = "0.1.3"
 unicode-segmentation = "1.2.1"
 
diff --git a/METADATA b/METADATA
index 1731bb3..b51a02f 100644
--- a/METADATA
+++ b/METADATA
@@ -7,14 +7,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/bstr/bstr-0.2.14.crate"
+    value: "https://static.crates.io/crates/bstr/bstr-0.2.15.crate"
   }
-  version: "0.2.14"
-  # Dual-licensed, using the least restrictive per go/thirdpartylicenses#same.
+  version: "0.2.15"
   license_type: NOTICE
   last_upgrade_date {
-    year: 2020
-    month: 12
-    day: 21
+    year: 2021
+    month: 4
+    day: 1
   }
 }
diff --git a/src/impls.rs b/src/impls.rs
index c7d0be3..4cba48e 100644
--- a/src/impls.rs
+++ b/src/impls.rs
@@ -33,7 +33,7 @@
             #[inline]
             fn eq(&self, other: &$lhs) -> bool {
                 let this: &[u8] = (&**other).as_ref();
-                PartialEq::eq(this, other.as_bytes())
+                PartialEq::eq(this, self.as_bytes())
             }
         }
     };
@@ -938,7 +938,7 @@
     use quickcheck::{Arbitrary, Gen};
 
     impl Arbitrary for BString {
-        fn arbitrary<G: Gen>(g: &mut G) -> BString {
+        fn arbitrary(g: &mut Gen) -> BString {
             BString::from(Vec::<u8>::arbitrary(g))
         }
 
@@ -967,3 +967,18 @@
         B(&format!("{:?}", b"\xFF\xEF\xBF\xBD\xFF".as_bstr())).as_bstr(),
     );
 }
+
+// See: https://github.com/BurntSushi/bstr/issues/82
+#[test]
+fn test_cows_regression() {
+    use crate::ByteSlice;
+    use std::borrow::Cow;
+
+    let c1 = Cow::from(b"hello bstr".as_bstr());
+    let c2 = b"goodbye bstr".as_bstr();
+    assert_ne!(c1, c2);
+
+    let c3 = Cow::from("hello str");
+    let c4 = "goodbye str";
+    assert_ne!(c3, c4);
+}