Module rustc_middle::hir::map::blocks[][src]

Expand description

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, 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

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.

Enums

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).

Traits

MaybeFnLike wraps a method that indicates if an object corresponds to some FnLikeNode.