Enum rustc::middle::region::CodeExtentExperimental
[-]
[+]
[src]
pub enum CodeExtent { Misc(NodeId), }
CodeExtent represents a statically-describable extent that can be used to bound the lifetime/region for values.
FIXME (pnkfelix): This currently derives PartialOrd
and Ord
to
placate the same deriving in ty::FreeRegion
, but we may want to
actually attach a more meaningful ordering to scopes than the one
generated via deriving here.
Variants
Misc |
Methods
impl CodeExtent
fn from_node_id(node_id: NodeId) -> CodeExtent
Creates a scope that represents the dynamic extent associated
with node_id
.
fn node_id(&self) -> NodeId
Returns a node id associated with this scope.
NB: likely to be replaced as API is refined; e.g. pnkfelix
anticipates fn entry_node_id
and fn each_exit_node_id
.
fn map_id<F>(&self, f_id: F) -> CodeExtent where F: FnOnce(NodeId) -> NodeId
Maps this scope to a potentially new one according to the
NodeId transformer f_id
.