#[non_exhaustive]#[repr(u16)]pub enum IssueCode {
Show 23 variants
Parse = 101,
UnresolvedPackage = 201,
NotAPackage = 202,
OrphanedBreak = 203,
DuplicateParam = 204,
ReadUninit = 205,
UnresolvedIdent = 206,
IntParse = 207,
FloatParse = 208,
UnreachableStatement = 209,
UnreachableArm = 210,
DuplicateEntry = 211,
LiteralAssignment = 212,
TypeMismatch = 301,
NilIndex = 302,
IndexTypeMismatch = 303,
UndefinedOperator = 304,
UndefinedDisplay = 305,
CallArityMismatch = 306,
FnArityMismatch = 307,
ResultMismatch = 308,
UnknownComponent = 309,
InconsistentReturns = 310,
}
Expand description
A classification of module diagnostic issues.
Each ModuleIssue object belongs to a specific class, as described by this enum type.
From an IssueCode, you can obtain additional metadata about the diagnostic issue, such as a short description (via the Display implementation of IssueCode) or the severity of the issue.
Additionally, you can convert an IssueCode into a numeric representation, which can be used to categorize diagnostics by their numeric codes in a code editor.
The numeric representation is in the XYY decimal digits format, where X represents the issue’s diagnostics depth, and YY represents the issue’s “sub-code” within that depth level.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Parse = 101
Syntax Error.
This error indicates that the source code is not well-formed from a syntactical point of view. These types of errors must be addressed first.
UnresolvedPackage = 201
Semantics Error.
The specified package in the use <package>;
import statement is
unknown to the script engine.
NotAPackage = 202
Semantics Error.
The component in the use foo.<component>;
import statement is not a
valid package.
OrphanedBreak = 203
Semantics Error.
The break
or continue
statement is used outside of a loop.
DuplicateParam = 204
Semantics Error.
The function already has a parameter with the same name. Function parameter names must be unique.
ReadUninit = 205
Semantics Error.
An attempt to use a variable that is not initialized at this point in the control flow.
UnresolvedIdent = 206
Semantics Error.
An attempt to use an identifier that does not correspond to any known variable within this scope or a package symbol.
IntParse = 207
Semantics Error.
Invalid integer literal format.
FloatParse = 208
Semantics Error.
Invalid floating-point literal format.
UnreachableStatement = 209
Semantics Warning.
This statement is not reachable during the execution of the source code. It is considered dead code. Consider removing this statement or commenting it out.
UnreachableArm = 210
Semantics Warning.
This match arm is not reachable during the execution of the source code. It is considered dead code. Consider removing this match arm or commenting it out.
DuplicateEntry = 211
Semantics Warning.
The struct
declaration already contains a field with the same name.
LiteralAssignment = 212
Semantics Warning.
An attempt to assign to an orphaned literal. This assignment is semantically meaningless.
TypeMismatch = 301
Semantics Warning.
The provided type does not meet the formal requirements of the specification.
NilIndex = 302
Semantics Warning.
An attempt to index into a nil object.
IndexTypeMismatch = 303
Semantics Warning.
An attempt to index by an expression that is neither a number nor a range of integers.
UndefinedOperator = 304
Semantics Warning.
The object does not implement the specified operator.
UndefinedDisplay = 305
Semantics Warning.
The object does not implement the Display operator.
CallArityMismatch = 306
Semantics Warning.
The function requires either more or fewer arguments.
FnArityMismatch = 307
Semantics Warning.
Expected a function with a different number of parameters.
ResultMismatch = 308
Semantics Warning.
The function’s result type is different from the expected type.
UnknownComponent = 309
Semantics Warning.
The object does not have the specified field.
InconsistentReturns = 310
Semantics Warning.
The function has inconsistent return points. Some branches return
non-nil values, while others return nil values. This issue likely
indicates that a trailing return <expr>;
statement is missing.
Implementations§
Source§impl IssueCode
impl IssueCode
Sourcepub fn severity(self) -> IssueSeverity
pub fn severity(self) -> IssueSeverity
Returns the issue’s severity, which is either an error or a warning.
Sourcepub fn depth(self) -> DiagnosticsDepth
pub fn depth(self) -> DiagnosticsDepth
Returns the level of semantic analysis depth at which this issue was inferred.
See DiagnosticsDepth for details.
Trait Implementations§
Source§impl Ord for IssueCode
impl Ord for IssueCode
Source§impl PartialOrd for IssueCode
impl PartialOrd for IssueCode
impl Copy for IssueCode
impl Eq for IssueCode
impl StructuralPartialEq for IssueCode
Auto Trait Implementations§
impl Freeze for IssueCode
impl RefUnwindSafe for IssueCode
impl Send for IssueCode
impl Sync for IssueCode
impl Unpin for IssueCode
impl UnwindSafe for IssueCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
. Read more