Skip to content

Add bounds to type aliases (needed by rust-lang/rust#54033). #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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