[−][src]Struct libslide::linter::stmt::homogenous_assignment::HomogenousAssignmentLinter
Fields
source: &'a str
asgn_op: Option<AssignmentOp>
The assignment op kind we expect to see across the program, set to the first assignment op we see.
diagnostics: Vec<Diagnostic>
Implementations
impl<'a> HomogenousAssignmentLinter<'a>
[src]
Trait Implementations
impl<'a> DiagnosticRecord for HomogenousAssignmentLinter<'a>
[src]
The homogenous assignment lint detects and warns on mixed use of assignment operators.
For example, the following program uses both the equality and assign-define operators to assign variables:
a = 1
b := 1
This can be misleading or confusing, as these two operators are syntactically different (and semantically different in canonical mathematics notation), but are treated the same in slide.
For this reason, it is suggested that exclusively =
or :=
are used for assignments in
slide programs.
impl<'a> LintRule<'a, StmtList> for HomogenousAssignmentLinter<'a>
[src]
impl<'a> StmtVisitor<'a> for HomogenousAssignmentLinter<'a>
[src]
fn visit_asgn_op(&mut self, asgn_op: &'a AssignmentOp)
[src]
fn visit_stmt_list(&mut self, stmt_list: &'a StmtList)
[src]
fn visit_stmt(&mut self, stmt: &'a Stmt)
[src]
fn visit_stmt_kind(&mut self, stmt_kind: &'a StmtKind)
[src]
fn visit_asgn(&mut self, asgn: &'a Assignment)
[src]
fn visit_expr(&mut self, expr: &'a RcExpr)
[src]
fn visit_const(&mut self, _konst: &'a f64, _span: Span)
[src]
fn visit_var(&mut self, _var: &'a InternedStr, _span: Span)
[src]
fn visit_binary_op(&mut self, _op: BinaryOperator)
[src]
fn visit_binary(&mut self, expr: &'a BinaryExpr<RcExpr>, span: Span)
[src]
fn visit_unary_op(&mut self, _op: UnaryOperator)
[src]
fn visit_unary(&mut self, expr: &'a UnaryExpr<RcExpr>, span: Span)
[src]
fn visit_parend(&mut self, expr: &'a RcExpr, span: Span)
[src]
fn visit_bracketed(&mut self, expr: &'a RcExpr, span: Span)
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for HomogenousAssignmentLinter<'a>
impl<'a> Send for HomogenousAssignmentLinter<'a>
impl<'a> Sync for HomogenousAssignmentLinter<'a>
impl<'a> Unpin for HomogenousAssignmentLinter<'a>
impl<'a> UnwindSafe for HomogenousAssignmentLinter<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,