Expand description
Expression / argument resolution: syn::Expr β semantic values.
The numeric-expression layer is parsed by the pest grammar (pest.rs);
everything that still needs rustcβs type context or syn structure lives
here: places (via place.rs), const generics, builtin integer bounds, the
length calls, tag argument types/targets, and ValidNum predicates.
Re-exportsΒ§
use crate::util::fn_info::parse_expr_into_number;πuse crate::util::mir_utils;πuse crate::util::name::access_ident_recursive;πuse crate::util::name::match_ty_with_ident;πuse quote::ToTokens;πuse rustc_hir::def::DefKind;πuse rustc_hir::def_id::DefId;πuse rustc_middle::ty::GenericParamDefKind;πuse rustc_middle::ty::IntTy;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_middle::ty::TyKind;πuse rustc_middle::ty::UintTy;πuse syn::Expr;πuse syn::Lit;πuse super::place;πuse super::ContractExpr;πuse super::ContractPlace;πuse super::NumericPredicate;πuse super::PlaceBase;πuse super::PropertyArg;πuse super::RelOp;π
FunctionsΒ§
- build_
interval_ πpredicates - expr_
to_ πpest - int_
type_ πmin_ max - outermost_
type_ πident - Extract the outermost path segment name from a
syn::Type, e.g.OptionfromOption<NonZero<T>>orNonZerofromNonZero<T>. - parse_
const_ πparam - parse_
contract_ πexpr - parse_
interval_ πpredicates - parse_
is_ πempty_ call - parse_
len_ πcall - parse_
numeric_ πpredicate - parse_
string_ πinterval - parse_
target_ πarg - parse_
type π - parse_
valid_ πnum - resolve_
self_ πmethod - resolve_
ty_ πident - Resolve a type identifier to a
Ty, handling theSelfkeyword (whichmatch_ty_with_identdoes not understand) by delegating toresolve_type_name. - resolve_
type_ πname - unwrap_
array_ πexpr - Extract the inner type from
[T](theSplitTransmute([T], [U])notation), then resolve it viaparse_type. The[T]argument arrives as eitherExpr::Array(JSON path, parsed viasyn::parse_str::<Expr>) orExpr::Verbatim(source annotation path, whereparse_property_argβs type-first parse turnsType::SliceintoVerbatim); both are unwrapped to the element typeT.