]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/free_region.rs
Rollup merge of #31055 - steveklabnik:alt-tags, r=alexcrichton
[rust.git] / src / librustc / middle / free_region.rs
index 744ceb3701dba862478d370ffd6d731b477dd9a6..face6d629340db1aaf6aef013984b1f38828c870 100644 (file)
 
 //! 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)]
@@ -135,7 +135,7 @@ pub fn is_subregion_of(&self,
                     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)) =>
@@ -162,8 +162,8 @@ pub fn is_static(&self, super_region: ty::FreeRegion) -> bool {
 
 #[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) }
 }
 
@@ -177,4 +177,3 @@ fn lub() {
     map.relate_free_regions(frs[1], frs[2]);
     assert_eq!(map.lub_free_regions(frs[0], frs[1]), ty::ReFree(frs[2]));
 }
-