Trait EarlyLintPass
pub trait EarlyLintPass<'ast>: Send + Sync {
Show 13 methods
// Provided methods
fn check_expr(
&mut self,
_ctx: &LintContext<'_, '_>,
_expr: &'ast Expr<'ast>,
) { ... }
fn check_item_struct(
&mut self,
_ctx: &LintContext<'_, '_>,
_item: &'ast ItemStruct<'ast>,
) { ... }
fn check_item_function(
&mut self,
_ctx: &LintContext<'_, '_>,
_item: &'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_doc_comment(
&mut self,
_ctx: &LintContext<'_, '_>,
_comment: &'ast DocComment<'ast>,
) { ... }
fn check_item(
&mut self,
_ctx: &LintContext<'_, '_>,
_item: &'ast Item<'ast>,
) { ... }
fn check_stmt(
&mut self,
_ctx: &LintContext<'_, '_>,
_stmt: &'ast Stmt<'ast>,
) { ... }
fn check_path(&mut self, _ctx: &LintContext<'_, '_>, _path: &'ast PathSlice) { ... }
fn check_ty(&mut self, _ctx: &LintContext<'_, '_>, _ty: &'ast Type<'ast>) { ... }
fn check_full_source_unit(
&mut self,
_ctx: &LintContext<'ast, '_>,
_ast: &'ast SourceUnit<'ast>,
) { ... }
}Expand description
A lint pass that runs directly on the parsed AST.
Provided Methods§
fn check_expr(&mut self, _ctx: &LintContext<'_, '_>, _expr: &'ast Expr<'ast>)
fn check_item_struct( &mut self, _ctx: &LintContext<'_, '_>, _item: &'ast ItemStruct<'ast>, )
fn check_item_function( &mut self, _ctx: &LintContext<'_, '_>, _item: &'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_doc_comment( &mut self, _ctx: &LintContext<'_, '_>, _comment: &'ast DocComment<'ast>, )
fn check_item(&mut self, _ctx: &LintContext<'_, '_>, _item: &'ast Item<'ast>)
fn check_stmt(&mut self, _ctx: &LintContext<'_, '_>, _stmt: &'ast Stmt<'ast>)
fn check_path(&mut self, _ctx: &LintContext<'_, '_>, _path: &'ast PathSlice)
fn check_ty(&mut self, _ctx: &LintContext<'_, '_>, _ty: &'ast Type<'ast>)
fn check_full_source_unit(
&mut self,
_ctx: &LintContext<'ast, '_>,
_ast: &'ast SourceUnit<'ast>,
)
fn check_full_source_unit( &mut self, _ctx: &LintContext<'ast, '_>, _ast: &'ast SourceUnit<'ast>, )
Runs after the complete source unit has been visited.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<'ast, const FUNCTIONS: bool> EarlyLintPass<'ast> for MixedCasePass<FUNCTIONS>
impl<'ast> EarlyLintPass<'ast> for BooleanCst
impl<'ast> EarlyLintPass<'ast> for BooleanEqual
impl<'ast> EarlyLintPass<'ast> for CustomErrors
impl<'ast> EarlyLintPass<'ast> for DangerousUnaryOperator
impl<'ast> EarlyLintPass<'ast> for EmptyBlock
impl<'ast> EarlyLintPass<'ast> for EventFields
impl<'ast> EarlyLintPass<'ast> for Imports
impl<'ast> EarlyLintPass<'ast> for IncorrectShift
impl<'ast> EarlyLintPass<'ast> for InlineAssembly
impl<'ast> EarlyLintPass<'ast> for InterfaceFileNaming
impl<'ast> EarlyLintPass<'ast> for LowLevelCalls
impl<'ast> EarlyLintPass<'ast> for MultiContractFilePass
impl<'ast> EarlyLintPass<'ast> for PascalCaseStructPass
impl<'ast> EarlyLintPass<'ast> for Rtlo
impl<'ast> EarlyLintPass<'ast> for ScreamingSnakeCase
impl<'ast> EarlyLintPass<'ast> for TodoComment
impl<'ast> EarlyLintPass<'ast> for TooManyDigits
impl<'ast> EarlyLintPass<'ast> for TxOrigin
impl<'ast> EarlyLintPass<'ast> for UncheckedCall
Unchecked low-level calls appear as standalone expression statements, or with the success value discarded in a tuple. When the success value is checked (in require, if, etc.), the call is part of a larger expression and is not flagged.