#[non_exhaustive]pub enum ValidationErrorKind {
Show 46 variants
DuplicateName {
name: String,
},
EmptyName,
UnknownSignature {
sig: SigId,
},
UnknownFunction {
func: FuncId,
},
UnknownGlobal {
global: GlobalId,
},
UnknownAggregate {
agg: AggId,
},
BadAggregate {
agg: AggId,
},
BadAlignment {
align: u64,
},
BadGlobal {
global: GlobalId,
},
MissingBody,
ImportWithBody,
BadEntry,
EntryParams {
expected: usize,
found: usize,
},
MissingTerminator,
BadBlockTarget {
target: Block,
},
EntryBranchTarget,
CorruptLayout,
ValueOutOfRange {
value: Value,
},
InconsistentDefinition {
value: Value,
},
DefinedTwice {
value: Value,
},
UseOfDetached {
value: Value,
},
BadAlias {
value: Value,
},
UseBeforeDef {
value: Value,
},
BadSlot {
slot: StackSlot,
},
TypeMismatch {
value: Option<Value>,
expected: Type,
found: Type,
},
BadOperandType {
op: &'static str,
found: Type,
},
BadConversion {
op: &'static str,
from: Type,
to: Type,
},
PolicyMismatch {
op: &'static str,
required: PolicyFields,
},
ErrorOutsideCheck {
op: &'static str,
},
NotFallible {
op: &'static str,
},
BadConst {
ty: Type,
bits: u64,
},
BadField {
agg: AggId,
field: u32,
},
BadOrdering,
ResultMismatch,
ArgCount {
expected: usize,
found: usize,
},
EdgeArgCount {
target: Block,
expected: usize,
found: usize,
},
BadSwitchCase {
value: u64,
},
BadTailCall,
BadGcList,
BadEdgeArg,
LandingPadPredecessor {
block: Block,
},
UnwindInNounwind,
ReturnInNoreturn,
SafepointInNogc,
LiveAcrossSafepoint {
value: Value,
},
DerivedPointerEscapes {
value: Value,
},
}Expand description
What is wrong, for a ValidationError (and for a BuildError::Invalid).
The enum is #[non_exhaustive]: new checks may add variants in a minor release.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DuplicateName
Two symbols share a name.
EmptyName
A symbol name is empty.
UnknownSignature
A signature handle is out of range.
UnknownFunction
A function handle is out of range.
UnknownGlobal
A global handle is out of range.
UnknownAggregate
An aggregate handle is out of range, or names a later aggregate.
BadAggregate
An aggregate’s recorded layout is inconsistent or too large.
BadAlignment
An alignment is not a supported power of two.
BadGlobal
A global’s initializer or relocations are inconsistent with its size or linkage.
MissingBody
A defined (local or exported) function has no body.
ImportWithBody
An imported function has a body.
BadEntry
The entry block handle is out of range or the block was removed.
EntryParams
The entry block’s parameters do not match the signature’s parameters.
Fields
MissingTerminator
A block has no terminator.
BadBlockTarget
An edge targets a block that does not exist or was removed.
EntryBranchTarget
An edge targets the entry block, which must have no predecessors.
CorruptLayout
The block’s instruction list is corrupt (a link is out of range, points into another block, or loops).
ValueOutOfRange
A value handle is out of range.
InconsistentDefinition
A value’s recorded definition disagrees with the block parameter list or the instruction result range that lists it.
DefinedTwice
A value is listed as defined at two sites.
UseOfDetached
A value whose definition was removed is still used.
BadAlias
A value’s forwarding (from replace_all_uses) is inconsistent: it loops or
changes type.
UseBeforeDef
A value is used where its definition does not dominate the use.
BadSlot
A stack slot handle is out of range, or a slot has a bad size or alignment.
TypeMismatch
A value has the wrong type for its position.
Fields
BadOperandType
An operand’s type is not one the operation accepts.
BadConversion
A conversion between these types is not allowed for this conversion op.
Fields
PolicyMismatch
An operation instance does not carry exactly the policy fields it needs.
ErrorOutsideCheck
An operation that can raise an error appears as a plain instruction; it
must be the operation of a check terminator. Fallible means: a policy
field is error; char_from_u32; or, on a signed integer type, pow
under any overflow policy (a negative exponent) or shl/shr under
shift = saturate (a negative amount). BinaryOp::can_error,
UnaryOp::can_error, and ConvOp::can_error are the rule.
NotFallible
A check terminator holds an operation that cannot raise an error, or an
instruction that is not a unary, binary, or conversion operation.
BadConst
A constant’s bits do not fit its type (or a ptr/ref constant is not 0).
BadField
A struct field index is out of range, or the aggregate is not a struct.
BadOrdering
An atomic operation has an ordering it may not have.
ResultMismatch
An instruction’s recorded result values disagree with what it produces (count or types).
ArgCount
A call passes the wrong number of arguments, or a return passes the wrong number of values.
EdgeArgCount
An edge passes the wrong number of arguments for its target’s parameters.
Fields
BadSwitchCase
A switch has two cases with the same value, or a case value does not fit the scrutinee’s type.
BadTailCall
A tail call’s callee returns or convention differ from this function’s, or a tail call carries a GC list.
BadGcList
A GC list entry is not a ref, or a nogc call carries a GC list.
BadEdgeArg
An edge argument is a Result, Exception, or ErrorCode where that kind is
not allowed, or a Result index is out of range.
LandingPadPredecessor
A landing pad (the target of an unwind edge) also has a non-unwind
predecessor, or an invoke’s normal and unwind edges target one block.
UnwindInNounwind
A nounwind function contains a resume, or a call that may unwind
without an invoke.
ReturnInNoreturn
A noreturn function contains a ret.
SafepointInNogc
A nogc function contains a safepoint.
LiveAcrossSafepoint
A ref value, or a pointer derived from one, is live across a safepoint
without being relocated through its GC list.
DerivedPointerEscapes
A pointer derived from a ref escapes tracking: it is stored to memory or
passed to a call that is a safepoint.