]> git.lizzy.rs Git - rust.git/commitdiff
Derives often have very strict bounds
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 16 Oct 2018 15:19:25 +0000 (17:19 +0200)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Fri, 19 Oct 2018 12:34:44 +0000 (14:34 +0200)
src/bootstrap/cache.rs

index 4a50f744e7a54e617b7373bf5ebbae9c601cf761..fd9a1be207280f788e98f0bacfebbe861c40679d 100644 (file)
@@ -169,12 +169,20 @@ fn cmp(&self, other: &Self) -> Ordering {
     }
 }
 
-#[derive(Default)]
 struct TyIntern<T: Hash + Clone + Eq> {
     items: Vec<T>,
     set: HashMap<T, Interned<T>>,
 }
 
+impl<T: Hash + Clone + Eq> Default for TyIntern<T> {
+    fn default() -> Self {
+        TyIntern {
+            items: Vec::new(),
+            set: Default::default(),
+        }
+    }
+}
+
 impl<T: Hash + Clone + Eq> TyIntern<T> {
     fn intern_borrow<B>(&mut self, item: &B) -> Interned<T>
     where