pub trait EarlyLintPass<'ast>: Send + Sync {
// Provided methods
fn check_expr(&mut self, _ctx: &LintContext<'_>, _expr: &'ast Expr<'ast>) { ... }
fn check_item_struct(
&mut self,
_ctx: &LintContext<'_>,
_struct: &'ast ItemStruct<'ast>,
) { ... }
fn check_item_function(
&mut self,
_ctx: &LintContext<'_>,
_func: &'ast ItemFunction<'ast>,
) { ... }
fn check_variable_definition(
&mut self,
_ctx: &LintContext<'_>,
_var: &'ast VariableDefinition<'ast>,
) { ... }
fn check_import_directive(
&mut self,
_ctx: &LintContext<'_>,
_import: &'ast ImportDirective<'ast>,
) { ... }
fn check_using_directive(
&mut self,
_ctx: &LintContext<'_>,
_using: &'ast UsingDirective<'ast>,
) { ... }
fn check_item_contract(
&mut self,
_ctx: &LintContext<'_>,
_contract: &'ast ItemContract<'ast>,
) { ... }
fn check_full_source_unit(
&mut self,
_ctx: &LintContext<'_>,
_ast: &'ast SourceUnit<'ast>,
) { ... }
}
Expand description
Trait for lints that operate directly on the AST.
Its methods mirror solar_ast::visit::Visit
, with the addition of LintCotext
.
Provided Methods§
fn check_expr(&mut self, _ctx: &LintContext<'_>, _expr: &'ast Expr<'ast>)
fn check_item_struct( &mut self, _ctx: &LintContext<'_>, _struct: &'ast ItemStruct<'ast>, )
fn check_item_function( &mut self, _ctx: &LintContext<'_>, _func: &'ast ItemFunction<'ast>, )
fn check_variable_definition( &mut self, _ctx: &LintContext<'_>, _var: &'ast VariableDefinition<'ast>, )
fn check_import_directive( &mut self, _ctx: &LintContext<'_>, _import: &'ast ImportDirective<'ast>, )
fn check_using_directive( &mut self, _ctx: &LintContext<'_>, _using: &'ast UsingDirective<'ast>, )
fn check_item_contract( &mut self, _ctx: &LintContext<'_>, _contract: &'ast ItemContract<'ast>, )
Sourcefn check_full_source_unit(
&mut self,
_ctx: &LintContext<'_>,
_ast: &'ast SourceUnit<'ast>,
)
fn check_full_source_unit( &mut self, _ctx: &LintContext<'_>, _ast: &'ast SourceUnit<'ast>, )
Should be called after the source unit has been visited. Enables lints that require knowledge of the entire AST to perform their analysis.
Implementors§
impl<'ast> EarlyLintPass<'ast> for AsmKeccak256
impl<'ast> EarlyLintPass<'ast> for IncorrectShift
impl<'ast> EarlyLintPass<'ast> for UncheckedCall
impl<'ast> EarlyLintPass<'ast> for UncheckedTransferERC20
WARN: can issue false positives. It does not check that the contract being called is an ERC20.