Expand description
This module contains functions that retrieve specific elements.
Re-exportsΒ§
use crate::consts::ConstEvalCtxt;πuse crate::consts::Constant;πuse crate::res::MaybeDef as _;πuse crate::is_expn_of;πuse crate::sym;πuse rustc_ast::ast;πuse rustc_attr_ir::lang_items::LangItem;πuse rustc_hir as hir;πuse rustc_hir::Arm;πuse rustc_hir::Block;πuse rustc_hir::Expr;πuse rustc_hir::ExprKind;πuse rustc_hir::HirId;πuse rustc_hir::LetStmt;πuse rustc_hir::LocalSource;πuse rustc_hir::LoopSource;πuse rustc_hir::MatchSource;πuse rustc_hir::Node;πuse rustc_hir::Pat;πuse rustc_hir::QPath;πuse rustc_hir::StructTailExpr;πuse rustc_lint::LateContext;πuse rustc_span::Span;πuse rustc_span::symbol;π
StructsΒ§
- Compound
Assignment - A desugared compound assignment statement, such as in
(a, b) = expr. - ForLoop
- The essential nodes of a desugared for loop as well as the entire span:
for pat in arg { body }becomes(pat, arg, body). Returns(pat, arg, body, span). - If
- An
ifexpression withoutlet - IfLet
- An
if letexpression - IfOr
IfLet - An
iforif letexpression - Range
- Represent a range akin to
ast::ExprKind::Range. - While
- A desugared
whileloop - While
Let - A desugared
while letloop
EnumsΒ§
- IfLet
OrMatch - An
if letormatchexpression. Useful for lints that trigger on one or the other. - RangeTy
- A type that can appear as the type of a range expression.
- VecArgs
- Represents the pre-expansion arguments of a
vec!invocation. - VecInit
Kind - A parsed
Vecinitialization expression
FunctionsΒ§
- binop
- Converts a
hirbinary operator to the correspondingasttype. - get_
vec_ init_ kind - Checks if the given expression is an initialization of
Vecand returns its kind. - has_
let_ expr - Checks that a condition doesnβt have a
letexpression, to keepIfandWhilefrom acceptingif letandwhile let.