-use crate::bit_set::BitMatrix;
+use rustc_index::bit_set::BitMatrix;
use crate::fx::FxHashMap;
-use crate::stable_hasher::{HashStable, StableHasher, StableHasherResult};
+use crate::stable_hasher::{HashStable, StableHasher};
use crate::sync::Lock;
use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
use std::fmt::Debug;
mod tests;
#[derive(Clone, Debug)]
-pub struct TransitiveRelation<T: Clone + Debug + Eq + Hash> {
+pub struct TransitiveRelation<T: Eq + Hash> {
// List of elements. This is used to map from a T to a usize.
elements: Vec<T>,
}
// HACK(eddyb) manual impl avoids `Default` bound on `T`.
-impl<T: Clone + Debug + Eq + Hash> Default for TransitiveRelation<T> {
+impl<T: Eq + Hash> Default for TransitiveRelation<T> {
fn default() -> Self {
TransitiveRelation {
elements: Default::default(),
}
}
-#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, RustcEncodable, RustcDecodable, Debug)]
struct Index(usize);
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)]
impl<CTX, T> HashStable<CTX> for TransitiveRelation<T>
where T: HashStable<CTX> + Eq + Debug + Clone + Hash
{
- fn hash_stable<W: StableHasherResult>(&self,
- hcx: &mut CTX,
- hasher: &mut StableHasher<W>) {
+ fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
// We are assuming here that the relation graph has been built in a
// deterministic way and we can just hash it the way it is.
let TransitiveRelation {
}
impl<CTX> HashStable<CTX> for Edge {
- fn hash_stable<W: StableHasherResult>(&self,
- hcx: &mut CTX,
- hasher: &mut StableHasher<W>) {
+ fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
let Edge {
ref source,
ref target,
}
impl<CTX> HashStable<CTX> for Index {
- fn hash_stable<W: StableHasherResult>(&self,
- hcx: &mut CTX,
- hasher: &mut StableHasher<W>) {
+ fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
let Index(idx) = *self;
idx.hash_stable(hcx, hasher);
}