Skip to content

Commit

Permalink
Merge pull request #13 from eddyb/alias-waffles
Browse files Browse the repository at this point in the history
Add bounds to type aliases (needed by rust-lang/rust#54033).
  • Loading branch information
nikomatsakis authored Sep 7, 2018
2 parents f94c3b2 + faa9e83 commit 31c5efb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Union-find, congruence closure, and other unification code. Based
license = "MIT/Apache-2.0"
homepage = "https://github.com/nikomatsakis/ena"
repository = "https://github.com/nikomatsakis/ena"
version = "0.10.0"
version = "0.10.1"
authors = ["Niko Matsakis <niko@alum.mit.edu>"]
readme = "README.md"
keywords = ["unification", "union-find"]
Expand Down
3 changes: 2 additions & 1 deletion src/unify/backing_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use std::marker::PhantomData;
use super::{VarValue, UnifyKey, UnifyValue};

#[allow(dead_code)] // rustc BUG
type Key<S> = <S as UnificationStore>::Key;
#[allow(type_alias_bounds)]
type Key<S: UnificationStore> = <S as UnificationStore>::Key;

/// Largely internal trait implemented by the unification table
/// backing store types. The most common such type is `InPlace`,
Expand Down
6 changes: 4 additions & 2 deletions src/unify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,13 @@ pub struct UnificationTable<S: UnificationStore> {
}

/// A unification table that uses an "in-place" vector.
pub type InPlaceUnificationTable<K> = UnificationTable<InPlace<K>>;
#[allow(type_alias_bounds)]
pub type InPlaceUnificationTable<K: UnifyKey> = UnificationTable<InPlace<K>>;

/// A unification table that uses a "persistent" vector.
#[cfg(feature = "persistent")]
pub type PersistentUnificationTable<K> = UnificationTable<Persistent<K>>;
#[allow(type_alias_bounds)]
pub type PersistentUnificationTable<K: UnifyKey> = UnificationTable<Persistent<K>>;

/// At any time, users may snapshot a unification table. The changes
/// made during the snapshot may either be *committed* or *rolled back*.
Expand Down

0 comments on commit 31c5efb

Please sign in to comment.