Struct rustc_trans::middle::region::RegionMapsExperimental [-]  [+] [src]

pub struct RegionMaps {
    // some fields omitted
}

The region maps encode information about region relationships.

Methods

impl RegionMaps

fn relate_free_regions(&self, sub: FreeRegion, sup: FreeRegion)

fn record_encl_scope(&self, sub: CodeExtent, sup: CodeExtent)

fn record_var_scope(&self, var: u32, lifetime: CodeExtent)

fn record_rvalue_scope(&self, var: u32, lifetime: CodeExtent)

fn mark_as_terminating_scope(&self, scope_id: CodeExtent)

Records that a scope is a TERMINATING SCOPE. Whenever we create automatic temporaries -- e.g. by an expression like a().f -- they will be freed within the innermost terminating scope.

fn opt_encl_scope(&self, id: CodeExtent) -> Option<CodeExtent>

Returns the narrowest scope that encloses id, if any.

fn encl_scope(&self, id: CodeExtent) -> CodeExtent

Returns the narrowest scope that encloses id, if any.

fn var_scope(&self, var_id: u32) -> CodeExtent

Returns the lifetime of the local variable var_id

fn temporary_scope(&self, expr_id: u32) -> Option<CodeExtent>

Returns the scope when temp created by expr_id will be cleaned up

fn var_region(&self, id: u32) -> Region

Returns the lifetime of the variable id.

fn scopes_intersect(&self, scope1: CodeExtent, scope2: CodeExtent) -> bool

fn is_subscope_of(&self, subscope: CodeExtent, superscope: CodeExtent) -> bool

Returns true if subscope is equal to or is lexically nested inside superscope and false otherwise.

fn sub_free_region(&self, sub: FreeRegion, sup: FreeRegion) -> bool

Determines whether two free regions have a subregion relationship by walking the graph encoded in free_region_map. Note that it is possible that sub != sup and sub <= sup and sup <= sub (that is, the user can give two different names to the same lifetime).

fn is_subregion_of(&self, sub_region: Region, super_region: Region) -> bool

Determines whether one region is a subregion of another. This is intended to run after inference and sadly the logic is somewhat duplicated with the code in infer.rs.

fn nearest_common_ancestor(&self, scope_a: CodeExtent, scope_b: CodeExtent) -> Option<CodeExtent>

Finds the nearest common ancestor (if any) of two scopes. That is, finds the smallest scope which is greater than or equal to both scope_a and scope_b.