rustc_ast::util

Module classify

Source
Expand description

Routines the parser and pretty-printer use to classify AST nodes.

Enums§

TrailingBrace

Functions§

expr_is_complete
This classification determines whether various syntactic positions break out of parsing the current expression (true) or continue parsing more of the same expression (false).
expr_requires_semi_to_be_stmt
Does this expression require a semicolon to be treated as a statement?
expr_trailing_brace
If an expression ends with }, returns the innermost expression ending in the }
leading_labeled_expr
Returns whether the leftmost token of the given expression is the label of a labeled loop or block, such as in 'inner: loop { break 'inner 1 } + 1.
path_return_type 🔒
Returns the trailing return type in the given path, if it has one.
type_trailing_braced_mac_call 🔒
If the type’s last token is }, it must be due to a braced macro call, such as in *const brace! { ... }. Returns that trailing macro call.