//! This file handles the relationships between free regions --
//! meaning lifetime parameters. Ordinarily, free regions are
-//! unrelated to one another, but they can be related vai implied or
+//! unrelated to one another, but they can be related via implied or
//! explicit bounds. In that case, we track the bounds using the
//! `TransitiveRelation` type and use that to decide when one free
//! region outlives another and so forth.
use middle::ty::{self, FreeRegion, Region};
-use middle::wf::ImpliedBound;
+use middle::ty::wf::ImpliedBound;
use rustc_data_structures::transitive_relation::TransitiveRelation;
#[derive(Clone)]
tcx.region_maps.is_subscope_of(sub_scope, super_scope),
(ty::ReScope(sub_scope), ty::ReFree(fr)) =>
- tcx.region_maps.is_subscope_of(sub_scope, fr.scope.to_code_extent()) ||
+ tcx.region_maps.is_subscope_of(sub_scope, fr.scope) ||
self.is_static(fr),
(ty::ReFree(sub_fr), ty::ReFree(super_fr)) =>
#[cfg(test)]
fn free_region(index: u32) -> FreeRegion {
- use middle::region::DestructionScopeData;
- FreeRegion { scope: DestructionScopeData::new(0),
+ use middle::region::DUMMY_CODE_EXTENT;
+ FreeRegion { scope: DUMMY_CODE_EXTENT,
bound_region: ty::BoundRegion::BrAnon(index) }
}
map.relate_free_regions(frs[1], frs[2]);
assert_eq!(map.lub_free_regions(frs[0], frs[1]), ty::ReFree(frs[2]));
}
-