Enum rustc_trans::middle::region::CodeExtentUnstable [-]  [+] [src]

pub enum CodeExtent {
    Misc(u32),
    Remainder(BlockRemainder),
}

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
Remainder

Methods

impl CodeExtent

fn from_node_id(node_id: u32) -> CodeExtent

Creates a scope that represents the dynamic extent associated with node_id.

fn node_id(&self) -> u32

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(u32), <F as FnOnce(u32)>::Output == u32

Maps this scope to a potentially new one according to the NodeId transformer f_id.

fn span(&self, ast_map: &Map) -> Option<Span>

Returns the span of this CodeExtent. Note that in general the returned span may not correspond to the span of any node id in the AST.

Trait Implementations

impl tr for CodeExtent

fn tr(&self, dcx: &DecodeContext) -> CodeExtent

impl<'tcx> Repr<'tcx> for CodeExtent

fn repr(&self, _tcx: &ctxt) -> String

Derived Implementations

impl Copy for CodeExtent

impl Debug for CodeExtent

fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>

impl Decodable for CodeExtent

fn decode<__D>(__arg_0: &mut __D) -> Result<CodeExtent, <__D as Decoder>::Error> where __D: Decoder

impl Encodable for CodeExtent

fn encode<__S>(&self, __arg_0: &mut __S) -> Result<(), <__S as Encoder>::Error> where __S: Encoder

impl<__S> Hash<__S> for CodeExtent where __S: Hasher, __S: Writer

fn hash(&self, __arg_0: &mut __S)

impl Ord for CodeExtent

fn cmp(&self, __arg_0: &CodeExtent) -> Ordering

impl Eq for CodeExtent

fn assert_receiver_is_total_eq(&self)

impl PartialOrd<CodeExtent> for CodeExtent

fn partial_cmp(&self, __arg_0: &CodeExtent) -> Option<Ordering>

fn lt(&self, __arg_0: &CodeExtent) -> bool

fn le(&self, __arg_0: &CodeExtent) -> bool

fn gt(&self, __arg_0: &CodeExtent) -> bool

fn ge(&self, __arg_0: &CodeExtent) -> bool

fn lt(&self, &CodeExtent) -> bool

fn le(&self, &CodeExtent) -> bool

fn gt(&self, &CodeExtent) -> bool

fn ge(&self, &CodeExtent) -> bool

impl PartialEq<CodeExtent> for CodeExtent

fn eq(&self, __arg_0: &CodeExtent) -> bool

fn ne(&self, __arg_0: &CodeExtent) -> bool

fn ne(&self, &CodeExtent) -> bool

impl Clone for CodeExtent

fn clone(&self) -> CodeExtent

fn clone_from(&mut self, &CodeExtent)