commit f45657d5a823a67bb3f5cffee65efbb401a44192
Author: Alex Huszagh <ahuszagh@gmail.com>
Date:   Mon Apr 12 18:30:54 2021 -0500

    Proposed fix for https://github.com/RustSec/advisory-db/pull/847

diff --git a/src/lib.rs b/src/lib.rs
index 21de1d9..0386413 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -894,27 +894,10 @@ impl<A: Array> iter::FromIterator<A::Item> for StackVec<A> {
 
 impl<A: Array> Extend<A::Item> for StackVec<A> {
     fn extend<I: iter::IntoIterator<Item=A::Item>>(&mut self, iterable: I) {
-        let mut iter = iterable.into_iter();
-        let (lower_bound, upper_bound) = iter.size_hint();
-        let upper_bound = upper_bound.expect("iterable must provide upper bound.");
-        assert!(self.len() + upper_bound <= self.capacity());
-
-        unsafe {
-            let len = self.len();
-            let ptr = self.as_mut_ptr().padd(len);
-            let mut count = 0;
-            while count < lower_bound {
-                if let Some(out) = iter.next() {
-                    ptr::write(ptr.padd(count), out);
-                    count += 1;
-                } else {
-                    break;
-                }
-            }
-            self.set_len(len + count);
-        }
-
-        for elem in iter {
+        // size_hint() has no safety guarantees, and TrustedLen
+        // is nightly only, so we can't do any optimizations with
+        // size_hint.
+        for elem in iterable.into_iter() {
             self.push(elem);
         }
     }
