use ty::wf::ImpliedBound;
use rustc_data_structures::transitive_relation::TransitiveRelation;
-#[derive(Clone)]
+#[derive(Clone, RustcEncodable, RustcDecodable)]
pub struct FreeRegionMap {
// Stores the relation `a < b`, where `a` and `b` are regions.
relation: TransitiveRelation<Region>
FreeRegionMap { relation: TransitiveRelation::new() }
}
+ pub fn is_empty(&self) -> bool {
+ self.relation.is_empty()
+ }
+
pub fn relate_free_regions_from_implied_bounds<'tcx>(&mut self,
implied_bounds: &[ImpliedBound<'tcx>])
{
match *predicate {
ty::Predicate::Projection(..) |
ty::Predicate::Trait(..) |
- ty::Predicate::Rfc1592(..) |
ty::Predicate::Equate(..) |
ty::Predicate::WellFormed(..) |
ty::Predicate::ObjectSafe(..) |
map.relate_free_regions(frs[1], frs[2]);
assert_eq!(map.lub_free_regions(frs[0], frs[1]), ty::ReFree(frs[2]));
}
+
+impl_stable_hash_for!(struct FreeRegionMap {
+ relation
+});