Module error

Module error 

Source
Expand description

Error message generation.

Here we provide the facilities to instanciate prebuilt error messages. The general structure is that each kind of error message will be implemented by a struct that implements IntoError, where the blanks are filled in by the struct fields’ Display and TrySpan impls.

Structs§

BasicDeprecated
An explicit error message with its span. This error construct is meant to be phased out in favor of a prebuilt error message.
BinopMismatch
Generate an error for a binary operator that expected arguments of a specific type.
BoolRequired
Generate an error for something that should have been a bool but isn’t, e.g. if 1 then 0 else 1.
ClkNotComparable
When two clocks are both non-implicit but different.
ClkNotIdentical
When two clocks should have been identical.
ClkTooSlowExpectImplicit
Generate an error when due to implicit that has the implicit clock, slow was expected to also have the implicit clock but doesn’t.
CmpNotAssociative
Error for when a comparison operator is used with associativity. Since a = b = c is ambiguous (does it mean (a = b) = c or a = (b = c) or (a = b) and (b = c), we choose to reject all interpretations and ask for explicit parentheses around comparison operators.
Cycle
Generate an error for a cyclic definition.
DisplayTrySpan
Generic wraper that implements Display and TrySpan to wrap together items that don’t implement both.
ExecutableNodeSig
Node is declared as executable, but has nonempty inputs or outputs.
FunNotFound
Generate an error for an undeclared function.
GraphUnitDeclTwice
Error message for an object that was defined twice when only one declaration should exist.
GraphUnitDependsOnItself
Special case of Cycle: custom message for an object that depends specifically on itself directly.
GraphUnitUndeclared
Error for an object that should have been declared but was not.
InapplicableAttribute
Attribute cannot apply to this language construct.
NotAClock
When an expression is not a valid clock (anything but a local variable).
NotConst
Generate an erorr for an expression that is noot valid in a const declaration.
NotPositive
Error for when one tried to access too far into the past.
Raw
An explicit sequence of errors and spans This error construct is meant to be phased out in favor of a prebuilt error message.
ScalarNotTuple
Two types cannot be equal because one is a tuple and the other a scalar
ShallowPre
Attempted to use a pre in register mode without any depth available
Suggest
Wrapper to display suggestions.
TyVarNotFound
Generate an error for a type variable that was not declared yet, which has consequences on what we should say is and isn’t available.
TypeMismatch
Generate an error for incompatible types between a “left” and a “right” values.
UndeclaredGeneric
When a generic type variable is unused and thus not inferrable.
UnhandledLitType
Error for a literal that is not supported. Lustre only has float, int, and bool literals, so e.g. a &str will trigger this error.
UnopMismatch
Generate an error for a unary operator that expected an argument of a specific type.
UnsatGenericConstraint
Impossible to satisfy generic constraints introduced by bounds.
UnusedGeneric
When a generic type variable is unused and thus not inferrable
VarNotFound
Generate an error for a variable that was not declared yet.

Traits§

IntoError
Generate an Error.
TryDefSite
Objects that have a different way that they can be seen as a span
TrySpan
Objects that can be converted to spans.

Type Aliases§

Error
Anything that went wrong: a sequence of Span and associated message.