Skip to content

Commit 31c5efb

Browse files
authored
Merge pull request #13 from eddyb/alias-waffles
Add bounds to type aliases (needed by rust-lang/rust#54033).
2 parents f94c3b2 + faa9e83 commit 31c5efb

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "Union-find, congruence closure, and other unification code. Based
44
license = "MIT/Apache-2.0"
55
homepage = "https://github.com/nikomatsakis/ena"
66
repository = "https://github.com/nikomatsakis/ena"
7-
version = "0.10.0"
7+
version = "0.10.1"
88
authors = ["Niko Matsakis <[email protected]>"]
99
readme = "README.md"
1010
keywords = ["unification", "union-find"]

src/unify/backing_vec.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use std::marker::PhantomData;
77
use super::{VarValue, UnifyKey, UnifyValue};
88

99
#[allow(dead_code)] // rustc BUG
10-
type Key<S> = <S as UnificationStore>::Key;
10+
#[allow(type_alias_bounds)]
11+
type Key<S: UnificationStore> = <S as UnificationStore>::Key;
1112

1213
/// Largely internal trait implemented by the unification table
1314
/// backing store types. The most common such type is `InPlace`,

src/unify/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,13 @@ pub struct UnificationTable<S: UnificationStore> {
181181
}
182182

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

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

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

0 commit comments

Comments
 (0)