Skip to main content

Module payable_loop

Module payable_loop 

Source
Expand description

Loop-context walker shared by the *-loop lints.

Visits every statement and expression that executes inside a loop of a function, following its modifier chain through _ and inlining the internal helpers it calls (including super dispatch, resolved against the contract the entry point belongs to).

Re-exportsยง

use crate::sol::analysis::is_builtin; ๐Ÿ”’
use crate::sol::analysis::loop_stmts; ๐Ÿ”’
use solar::ast::StateMutability; ๐Ÿ”’
use solar::ast::Visibility; ๐Ÿ”’
use solar::interface::sym; ๐Ÿ”’
use solar::sema::Gcx; ๐Ÿ”’
use solar::sema::hir::Block; ๐Ÿ”’
use solar::sema::hir::ContractId; ๐Ÿ”’
use solar::sema::hir::Expr; ๐Ÿ”’
use solar::sema::hir::ExprKind; ๐Ÿ”’
use solar::sema::hir::Function; ๐Ÿ”’
use solar::sema::hir::FunctionId; ๐Ÿ”’
use solar::sema::hir::FunctionKind; ๐Ÿ”’
use solar::sema::hir::Hir; ๐Ÿ”’
use solar::sema::hir::Modifier; ๐Ÿ”’
use solar::sema::hir::Stmt; ๐Ÿ”’
use solar::sema::hir::StmtKind; ๐Ÿ”’
use solar::sema::hir::Visit; ๐Ÿ”’
use solar::sema::ty::TyKind; ๐Ÿ”’
use std::convert::Infallible; ๐Ÿ”’
use std::ops::ControlFlow; ๐Ÿ”’

Structsยง

LoopWalker ๐Ÿ”’

Enumsยง

LoopItem ๐Ÿ”’
A statement or expression reached inside a loop.

Functionsยง

for_each_loop_item ๐Ÿ”’
Calls f for every statement and expression executing inside a loop of func. Internal helpers called from a loop are inlined; with follow_calls_outside_loop, so are helpers called outside one, so that their own loops are reported too.
for_each_payable_loop_expr ๐Ÿ”’
Calls f for every expression executing inside a loop of a payable entry point, including loops in the internal helpers it calls (whether the call itself sits in a loop or not).

Type Aliasesยง

Continuation ๐Ÿ”’
The rest of a modifier chain and the function body it wraps, executed at _.