[][src]Struct libslide::linter::stmt::homogenous_assignment::HomogenousAssignmentLinter

pub struct HomogenousAssignmentLinter<'a> {
    source: &'a str,
    asgn_op: Option<AssignmentOp>,
    diagnostics: Vec<Diagnostic>,
}

Fields

source: &'a strasgn_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]

pub fn new(source: &'a str) -> Self[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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.