Skip to main content Module hir_utils Copy item path Source use crate::consts::ConstEvalCtxt ; π use crate::macros::macro_backtrace ; π use crate::source::SpanExt as _; π use crate::source::SpanRange ; π use crate::source::walk_span_to_context ; π use crate::sym ; π use crate::tokenize_with_text ; π use core::mem ; π use rustc_ast::ast; π use rustc_ast::ast::InlineAsmTemplatePiece; π use rustc_data_structures::fx::FxHasher; π use rustc_data_structures::fx::FxIndexMap; π use rustc_hir::MatchSource::TryDesugar; π use rustc_hir::def::DefKind; π use rustc_hir::def::Res; π use rustc_hir::def_id::DefId; π use rustc_hir::AssocItemConstraint; π use rustc_hir::BinOpKind; π use rustc_hir::BindingMode; π use rustc_hir::Block; π use rustc_hir::BodyId; π use rustc_hir::ByRef; π use rustc_hir::Closure; π use rustc_hir::ConstArg; π use rustc_hir::ConstArgKind; π use rustc_hir::ConstItemRhs; π use rustc_hir::Expr; π use rustc_hir::ExprField; π use rustc_hir::ExprKind; π use rustc_hir::FnDecl; π use rustc_hir::FnRetTy; π use rustc_hir::FnSig; π use rustc_hir::GenericArg; π use rustc_hir::GenericArgs; π use rustc_hir::GenericBound; π use rustc_hir::GenericBounds; π use rustc_hir::GenericParam; π use rustc_hir::GenericParamKind; π use rustc_hir::GenericParamSource; π use rustc_hir::Generics; π use rustc_hir::HirId; π use rustc_hir::HirIdMap; π use rustc_hir::InlineAsmOperand; π use rustc_hir::ItemId; π use rustc_hir::ItemKind; π use rustc_hir::LetExpr; π use rustc_hir::Lifetime; π use rustc_hir::LifetimeKind; π use rustc_hir::LifetimeParamKind; π use rustc_hir::Node; π use rustc_hir::ParamName; π use rustc_hir::Pat; π use rustc_hir::PatExpr; π use rustc_hir::PatExprKind; π use rustc_hir::PatField; π use rustc_hir::PatKind; π use rustc_hir::Path; π use rustc_hir::PathSegment; π use rustc_hir::PreciseCapturingArgKind; π use rustc_hir::PrimTy; π use rustc_hir::QPath; π use rustc_hir::Stmt; π use rustc_hir::StmtKind; π use rustc_hir::StructTailExpr; π use rustc_hir::TraitBoundModifiers; π use rustc_hir::Ty; π use rustc_hir::TyFieldPath; π use rustc_hir::TyKind; π use rustc_hir::TyPat; π use rustc_hir::TyPatKind; π use rustc_hir::UseKind; π use rustc_hir::UseTree; π use rustc_hir::WherePredicate; π use rustc_hir::WherePredicateKind; π use rustc_lexer::FrontmatterAllowed; π use rustc_lexer::TokenKind; π use rustc_lexer::tokenize; π use rustc_lint::LateContext; π use rustc_middle::ty::TypeckResults; π use rustc_span::BytePos; π use rustc_span::ExpnKind; π use rustc_span::MacroKind; π use rustc_span::Symbol; π use rustc_span::SyntaxContext; π use std::hash::Hash as _; π use std::hash::Hash as _; π use std::hash::Hasher as _; π use std::ops::Range ; π use std::slice ; π HirEqInterExpr SpanlessEq Type used to check whether two ast are the same. This is different from the
operator == on ast types as this operator would compare true equality with
ID and span. SpanlessHash Type used to hash an ast element. This is different from the Hash trait
on ast types as this
trait would consider IDs and spans. PathCheck Determines how paths are hashed and compared for equality. both Checks if the two Options are both None or some equal values as per
eq_fn. both_some_and Checks if the two Options are both Some and pass the predicate function. count_eq Counts how many elements of the slices are equal as per eq_fn. eq_expr_value Checks if two expressions evaluate to the same value, and donβt contain any side effects. eq_span_tokens π generic_path_segments π Returns the segments of a path that might have generic parameters.
Usually just the last segment for free items, except for when the path resolves to an associated
item, in which case it is the last two has_ambiguous_literal_in_expr Returns true if the expression contains ambiguous literals (unsuffixed float or int literals)
that could be interpreted as either f32/f64 or i32/i64 depending on context. hash_expr hash_stmt is_bool over Checks if two slices are equal as per eq_fn. reduce_exprkind π Some simple reductions like { return } => return SpanlessEqCallback π Callback that is called when two expressions are not equal in the sense of SpanlessEq, but
other conditions would make them equal.