hir::[−][src] map:: blocks
This module provides a simplified abstraction for working with
code blocks identified by their integer
NodeId. In particular,
it captures a common set of attributes that all “function-like
things” (represented by
FnLike instances) share. For example,
FnLike instances have a type signature (be it explicit or
inferred). And all
FnLike instances have a body, i.e., the code
that is run when the function-like thing it represents is invoked.
With the above abstraction in place, one can treat the program
text as a collection of blocks of code (and most such blocks are
nested within a uniquely determined
FnLike), and users can ask
Code associated with a particular NodeId.
These are all the components one can extract from a closure expr for use when implementing FnLikeNode operations.
An FnLikeNode is a Node that is like a fn, in that it has a decl and a body (as well as a NodeId, a span, etc).
These are all the components one can extract from a fn item for use when implementing FnLikeNode operations.
Carries either an FnLikeNode or an Expr, as these are the two constructs that correspond to “code” (as in, something from which we can construct a control-flow graph).
MaybeFnLike wraps a method that indicates if an object corresponds to some FnLikeNode.