pub trait LateLintPass<'hir>: Send + Sync {
Show 14 methods
// Provided methods
fn check_nested_source(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_id: SourceId,
) { ... }
fn check_nested_item(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_id: ItemId,
) { ... }
fn check_nested_contract(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'hir>,
_hir: &'hir Hir<'hir>,
_id: ContractId,
) { ... }
fn check_nested_function(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_id: FunctionId,
) { ... }
fn check_nested_var(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_id: VariableId,
) { ... }
fn check_item(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_item: Item<'hir, 'hir>,
) { ... }
fn check_contract(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'hir>,
_hir: &'hir Hir<'hir>,
_contract: &'hir Contract<'hir>,
) { ... }
fn check_function(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'hir>,
_hir: &'hir Hir<'hir>,
_func: &'hir Function<'hir>,
) { ... }
fn check_modifier(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_mod: &'hir Modifier<'hir>,
) { ... }
fn check_var(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_var: &'hir Variable<'hir>,
) { ... }
fn check_expr(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'hir>,
_hir: &'hir Hir<'hir>,
_expr: &'hir Expr<'hir>,
) { ... }
fn check_call_args(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_args: &'hir CallArgs<'hir>,
) { ... }
fn check_stmt(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'hir>,
_hir: &'hir Hir<'hir>,
_stmt: &'hir Stmt<'hir>,
) { ... }
fn check_ty(
&mut self,
_ctx: &LintContext<'_, '_>,
_hir: &'hir Hir<'hir>,
_ty: &'hir Type<'hir>,
) { ... }
}Expand description
Trait for lints that operate on the HIR (High-level Intermediate Representation).
Its methods mirror hir::visit::Visit, with the addition of LintContext.
Provided Methods§
fn check_nested_source( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _id: SourceId, )
fn check_nested_item( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _id: ItemId, )
fn check_nested_contract( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'hir>, _hir: &'hir Hir<'hir>, _id: ContractId, )
fn check_nested_function( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _id: FunctionId, )
fn check_nested_var( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _id: VariableId, )
fn check_item( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _item: Item<'hir, 'hir>, )
fn check_contract( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'hir>, _hir: &'hir Hir<'hir>, _contract: &'hir Contract<'hir>, )
fn check_function( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'hir>, _hir: &'hir Hir<'hir>, _func: &'hir Function<'hir>, )
fn check_modifier( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _mod: &'hir Modifier<'hir>, )
fn check_var( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _var: &'hir Variable<'hir>, )
fn check_expr( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'hir>, _hir: &'hir Hir<'hir>, _expr: &'hir Expr<'hir>, )
fn check_call_args( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _args: &'hir CallArgs<'hir>, )
fn check_stmt( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'hir>, _hir: &'hir Hir<'hir>, _stmt: &'hir Stmt<'hir>, )
fn check_ty( &mut self, _ctx: &LintContext<'_, '_>, _hir: &'hir Hir<'hir>, _ty: &'hir Type<'hir>, )
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<'hir> LateLintPass<'hir> for ArbitrarySendErc20
impl<'hir> LateLintPass<'hir> for ArbitrarySendEth
impl<'hir> LateLintPass<'hir> for AsmKeccak256
impl<'hir> LateLintPass<'hir> for AssertStateChange
impl<'hir> LateLintPass<'hir> for BlockTimestamp
impl<'hir> LateLintPass<'hir> for CacheArrayLength
impl<'hir> LateLintPass<'hir> for CallsLoop
impl<'hir> LateLintPass<'hir> for ControlledDelegatecall
impl<'hir> LateLintPass<'hir> for CostlyLoop
impl<'hir> LateLintPass<'hir> for DelegatecallLoop
impl<'hir> LateLintPass<'hir> for DivideBeforeMultiply
impl<'hir> LateLintPass<'hir> for EncodedPackedCollision
impl<'hir> LateLintPass<'hir> for ExternalFunction
impl<'hir> LateLintPass<'hir> for IncorrectERC20Interface
impl<'hir> LateLintPass<'hir> for IncorrectERC721Interface
impl<'hir> LateLintPass<'hir> for IncorrectStrictEquality
impl<'hir> LateLintPass<'hir> for LockedEther
impl<'hir> LateLintPass<'hir> for MissingEventsAccessControl
impl<'hir> LateLintPass<'hir> for MissingEventsArithmetic
impl<'hir> LateLintPass<'hir> for MissingZeroCheck
impl<'hir> LateLintPass<'hir> for MsgValueLoop
impl<'hir> LateLintPass<'hir> for NamedStructFields
impl<'hir> LateLintPass<'hir> for RedundantBaseConstructorCall
impl<'hir> LateLintPass<'hir> for ReentrancyEth
impl<'hir> LateLintPass<'hir> for ReentrancyEvents
impl<'hir> LateLintPass<'hir> for ReturnBomb
impl<'hir> LateLintPass<'hir> for TypeBasedTautology
impl<'hir> LateLintPass<'hir> for UnchangedStateVariables
impl<'hir> LateLintPass<'hir> for UncheckedTransferERC20
Checks that calls to functions with the same signature as the ERC20 transfer methods, and which return a boolean are not ignored.
WARN: can issue false positives, as it doesn’t check that the contract being called sticks to the full ERC20 specification.