Module rustc::hir::map::blocks
[−]
[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
This module provides a simplified abstraction for working with
code blocks identified by their integer node-id. In particular,
it captures a common set of attributes that all "function-like
things" (represented by FnLike instances) share. For example,
all 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
for the Code associated with a particular NodeId.
Structs
| FnLikeNode |
[ Experimental ] 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). |
Enums
| Code |
[ Experimental ] Carries either an FnLikeNode or a Expr, as these are the two constructs that correspond to "code" (as in, something from which we can construct a control-flow graph). |
Traits
| MaybeFnLike |
[ Experimental ] MaybeFnLike wraps a method that indicates if an object corresponds to some FnLikeNode. |