Skip to main content

Module higher

Module higher 

Source
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Β§

CompoundAssignment
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 if expression without let
IfLet
An if let expression
IfOrIfLet
An if or if let expression
Range
Represent a range akin to ast::ExprKind::Range.
While
A desugared while loop
WhileLet
A desugared while let loop

EnumsΒ§

IfLetOrMatch
An if let or match expression. 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.
VecInitKind
A parsed Vec initialization expression

FunctionsΒ§

binop
Converts a hir binary operator to the corresponding ast type.
get_vec_init_kind
Checks if the given expression is an initialization of Vec and returns its kind.
has_let_expr
Checks that a condition doesn’t have a let expression, to keep If and While from accepting if let and while let.