pub trait Analyzer<'a> {
type Info: Clone;
// Required methods
fn merge_match(
&mut self,
statement_location: StatementLocation,
match_info: &'a MatchInfo,
infos: impl Iterator<Item = Self::Info>,
) -> Self::Info;
fn info_from_return(
&mut self,
statement_location: StatementLocation,
vars: &'a [VarUsage],
) -> Self::Info;
// Provided methods
fn visit_block_start(
&mut self,
info: &mut Self::Info,
block_id: BlockId,
block: &FlatBlock,
) { ... }
fn visit_stmt(
&mut self,
info: &mut Self::Info,
statement_location: StatementLocation,
stmt: &'a Statement,
) { ... }
fn visit_goto(
&mut self,
info: &mut Self::Info,
statement_location: StatementLocation,
target_block_id: BlockId,
remapping: &VarRemapping,
) { ... }
fn info_from_panic(
&mut self,
statement_location: StatementLocation,
var: &VarUsage,
) -> Self::Info { ... }
}
Expand description
Analyzer trait to implement for each specific analysis.
Required Associated Types§
Required Methods§
fn merge_match( &mut self, statement_location: StatementLocation, match_info: &'a MatchInfo, infos: impl Iterator<Item = Self::Info>, ) -> Self::Info
fn info_from_return( &mut self, statement_location: StatementLocation, vars: &'a [VarUsage], ) -> Self::Info
Provided Methods§
fn visit_block_start( &mut self, info: &mut Self::Info, block_id: BlockId, block: &FlatBlock, )
fn visit_stmt( &mut self, info: &mut Self::Info, statement_location: StatementLocation, stmt: &'a Statement, )
fn visit_goto( &mut self, info: &mut Self::Info, statement_location: StatementLocation, target_block_id: BlockId, remapping: &VarRemapping, )
Sourcefn info_from_panic(
&mut self,
statement_location: StatementLocation,
var: &VarUsage,
) -> Self::Info
fn info_from_panic( &mut self, statement_location: StatementLocation, var: &VarUsage, ) -> Self::Info
Default info_from_panic
implementation for post ‘lower_panics’ phases.
Earlier phases need to override this implementation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.