Skip to content

Commit

Permalink
Add bounds to type aliases (needed by rust-lang/rust#54033).
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Sep 7, 2018
1 parent f94c3b2 commit fec1286
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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 fec1286

Please sign in to comment.