closure: Lock<Option<BitMatrix<usize, usize>>>,
}
+// HACK(eddyb) manual impl avoids `Default` bound on `T`.
+impl<T: Clone + Debug + Eq + Hash> Default for TransitiveRelation<T> {
+ fn default() -> Self {
+ TransitiveRelation {
+ elements: Default::default(),
+ map: Default::default(),
+ edges: Default::default(),
+ closure: Default::default(),
+ }
+ }
+}
+
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug)]
struct Index(usize);
target: Index,
}
-impl<T: Clone + Debug + Eq + Hash> Default for TransitiveRelation<T> {
- fn default() -> TransitiveRelation<T> {
- TransitiveRelation {
- elements: vec![],
- map: FxHashMap::default(),
- edges: vec![],
- closure: Lock::new(None),
- }
- }
-}
-
impl<T: Clone + Debug + Eq + Hash> TransitiveRelation<T> {
pub fn is_empty(&self) -> bool {
self.edges.is_empty()
///
/// The intuition is that this moves "one step up" through a lattice
/// (where the relation is encoding the `<=` relation for the lattice).
- /// So e.g. if the relation is `->` and we have
+ /// So e.g., if the relation is `->` and we have
///
/// ```
/// a -> b -> d -> f