Skip to content

Commit fec1286

Browse files
committed
Add bounds to type aliases (needed by rust-lang/rust#54033).
1 parent f94c3b2 commit fec1286

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/unify/backing_vec.rs

Lines changed: 2 additions & 1 deletion
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

Lines changed: 4 additions & 2 deletions
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)