Skip to main content

CodegenErrorKind

Enum CodegenErrorKind 

Source
pub enum CodegenErrorKind {
Show 55 variants LockingError, StoragePointersNotDerived, InvalidMacroStatement, MissingArgumentDefinition(String), MissingMacroDefinition(String), MissingFunctionInterface(String), MissingEventInterface(String), MissingConstantDefinition(String), StringConstantNotBytes(String), MissingErrorDefinition(String), AbiGenerationFailure, UnmatchedJumpLabels(Vec<String>), IOError(String), UnkownArgcallType, MissingMacroInvocation(String), InvalidMacroInvocation(String), InvalidArgumentCount(String, usize, usize), UsizeConversion(String), InvalidArguments(String), InvalidMacroArgumentType(String), InvalidHex(String), InvalidTableStatement(String), InvalidCodeLength(usize), TestInvocation(String), InvalidConstructorArgs(String), ArgsStartOutsideConstructor, MissingTableSize(String), UnsupportedBuiltinFunction(String), RuntimeSizeNotComputed, CodesizeRuntimeInCodeTable, CodesizeNotConverged(usize), UnsupportedStatementType(String), DuplicateLabelInScope(String), DuplicateLabelAcrossSiblings(String), DuplicateTableEmbedding(String), JumpTargetTooLarge { label: String, target: usize, opcode: String, }, CircularMacroInvocation(String), CircularConstantDependency(String), RecursionDepthExceeded(usize), UndefinedConstant(String), InvalidConstantExpression, ArithmeticOverflow, ArithmeticUnderflow, DivisionByZero, ArgCallInConstantExpression(String), InvalidOpcodeForEVMVersion(String, String, String), InvalidLoopStep, LoopIterationLimitExceeded(usize), AssertPcFailed(usize, usize), ArgResolutionLimitExceeded(String, usize), BubbleArgLimitExceeded(String, usize), ContractSizeLimitExceeded(usize, usize), InitcodeSizeLimitExceeded(usize, usize), InvalidOpcodeOperand(String), OffsetExceedsTwoBytes(String, usize),
}
Expand description

The Code Generation Error Kind

Variants§

§

LockingError

Locking Error

§

StoragePointersNotDerived

Storage Pointers Not Derived

§

InvalidMacroStatement

Invalid Macro Body Statement

§

MissingArgumentDefinition(String)

The Argument Definition is Missing

§

MissingMacroDefinition(String)

The Macro Definition is Missing

§

MissingFunctionInterface(String)

The Function Interface is Missing

§

MissingEventInterface(String)

The Event Interface is Missing

§

MissingConstantDefinition(String)

Missing Constant Definition

§

StringConstantNotBytes(String)

String constant used directly instead of with __BYTES builtin

§

MissingErrorDefinition(String)

Missing Error Definition

§

AbiGenerationFailure

Abi Generation Failure

§

UnmatchedJumpLabels(Vec<String>)

Unmatched Jump

§

IOError(String)

An IO Error

§

UnkownArgcallType

ArgCall has an unknown type

§

MissingMacroInvocation(String)

Missing Macro Invocation

§

InvalidMacroInvocation(String)

Missing Macro Definition for Invocation

§

InvalidArgumentCount(String, usize, usize)

Invalid Argument Count with macro name, expected and actual

§

UsizeConversion(String)

Conversion Error for usize

§

InvalidArguments(String)

Invalid Arguments

§

InvalidMacroArgumentType(String)

Invalid Macro Argument Type (e.g., cannot invoke __NOOP as a macro)

§

InvalidHex(String)

Invalid Hex String

§

InvalidTableStatement(String)

Invalid Table Statement

§

InvalidCodeLength(usize)

Invalid Code Length

§

TestInvocation(String)

Test Invocation

§

InvalidConstructorArgs(String)

Constructor arguments that do not match the declared constructor or cannot be read

§

ArgsStartOutsideConstructor

__argsstart() outside the constructor, where constructor arguments do not exist

§

MissingTableSize(String)

Missing Table Size

§

UnsupportedBuiltinFunction(String)

Unsupported Builtin Function

§

RuntimeSizeNotComputed

__codesize(RUNTIME) referenced before the runtime size has been computed (e.g. when the constructor is compiled in isolation without first generating MAIN).

§

CodesizeRuntimeInCodeTable

__codesize(RUNTIME) referenced inside a code table. Code tables contribute to the runtime size, so embedding the runtime size inside one creates a circular dependency.

§

CodesizeNotConverged(usize)

Codegen failed to converge on stable __codesize values within the iteration cap.

§

UnsupportedStatementType(String)

Unsupported Statement Type

§

DuplicateLabelInScope(String)

Duplicate Label in Same Scope

§

DuplicateLabelAcrossSiblings(String)

Duplicate label defined in multiple sibling scopes When a label is not found in current scope, fallback searches siblings - but will always find the first definition, making subsequent ones unreachable

§

DuplicateTableEmbedding(String)

Duplicate Table Embedding

§

JumpTargetTooLarge

Jump target is too large for the specified opcode

Fields

§label: String

The label name

§target: usize

The target offset that was too large

§opcode: String

The opcode that couldn’t represent the target

§

CircularMacroInvocation(String)

Circular macro invocation detected

§

CircularConstantDependency(String)

Circular constant dependency detected

§

RecursionDepthExceeded(usize)

Recursion depth limit exceeded

§

UndefinedConstant(String)

Undefined constant in expression

§

InvalidConstantExpression

Invalid constant expression (contains runtime elements)

§

ArithmeticOverflow

Arithmetic overflow in constant expression

§

ArithmeticUnderflow

Arithmetic underflow in constant expression

§

DivisionByZero

Division by zero in constant expression

§

ArgCallInConstantExpression(String)

ArgCall in constant expression (requires macro invocation context)

§

InvalidOpcodeForEVMVersion(String, String, String)

Invalid opcode for EVM version (opcode, required_version, current_version)

§

InvalidLoopStep

Invalid loop step value (step cannot be zero)

§

LoopIterationLimitExceeded(usize)

Loop iteration limit exceeded (contains max limit)

§

AssertPcFailed(usize, usize)

PC (program counter) assertion failed (expected, actual)

§

ArgResolutionLimitExceeded(String, usize)

Exceeded maximum iterations when resolving argument references through the scope chain First parameter is the argument name, second is the maximum allowed iterations

§

BubbleArgLimitExceeded(String, usize)

Exceeded maximum iterations in bubble_arg_call when bubbling up through nested macro calls First parameter is the argument name, second is the maximum allowed iterations

§

ContractSizeLimitExceeded(usize, usize)

Runtime bytecode exceeds the contract size limit of the target EVM version (size, limit)

§

InitcodeSizeLimitExceeded(usize, usize)

Deployment bytecode exceeds the initcode size limit of the target EVM version (size, limit)

§

InvalidOpcodeOperand(String)

An opcode operand resolved to a value the opcode cannot encode (description)

§

OffsetExceedsTwoBytes(String, usize)

A bytecode offset that is stored in a fixed 2-byte field exceeds 0xffff (what, offset)

Trait Implementations§

Source§

impl Clone for CodegenErrorKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CodegenErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CodegenErrorKind

Source§

impl PartialEq for CodegenErrorKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CodegenErrorKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 72 bytes

Size for each variant:

  • LockingError: 0 bytes
  • StoragePointersNotDerived: 0 bytes
  • InvalidMacroStatement: 0 bytes
  • MissingArgumentDefinition: 32 bytes
  • MissingMacroDefinition: 32 bytes
  • MissingFunctionInterface: 32 bytes
  • MissingEventInterface: 32 bytes
  • MissingConstantDefinition: 32 bytes
  • StringConstantNotBytes: 32 bytes
  • MissingErrorDefinition: 32 bytes
  • AbiGenerationFailure: 0 bytes
  • UnmatchedJumpLabels: 32 bytes
  • IOError: 32 bytes
  • UnkownArgcallType: 0 bytes
  • MissingMacroInvocation: 32 bytes
  • InvalidMacroInvocation: 32 bytes
  • InvalidArgumentCount: 48 bytes
  • UsizeConversion: 32 bytes
  • InvalidArguments: 32 bytes
  • InvalidMacroArgumentType: 32 bytes
  • InvalidHex: 32 bytes
  • InvalidTableStatement: 32 bytes
  • InvalidCodeLength: 16 bytes
  • TestInvocation: 32 bytes
  • InvalidConstructorArgs: 32 bytes
  • ArgsStartOutsideConstructor: 0 bytes
  • MissingTableSize: 32 bytes
  • UnsupportedBuiltinFunction: 32 bytes
  • RuntimeSizeNotComputed: 0 bytes
  • CodesizeRuntimeInCodeTable: 0 bytes
  • CodesizeNotConverged: 16 bytes
  • UnsupportedStatementType: 32 bytes
  • DuplicateLabelInScope: 32 bytes
  • DuplicateLabelAcrossSiblings: 32 bytes
  • DuplicateTableEmbedding: 32 bytes
  • JumpTargetTooLarge: 64 bytes
  • CircularMacroInvocation: 32 bytes
  • CircularConstantDependency: 32 bytes
  • RecursionDepthExceeded: 16 bytes
  • UndefinedConstant: 32 bytes
  • InvalidConstantExpression: 0 bytes
  • ArithmeticOverflow: 0 bytes
  • ArithmeticUnderflow: 0 bytes
  • DivisionByZero: 0 bytes
  • ArgCallInConstantExpression: 32 bytes
  • InvalidOpcodeForEVMVersion: 72 bytes
  • InvalidLoopStep: 0 bytes
  • LoopIterationLimitExceeded: 16 bytes
  • AssertPcFailed: 24 bytes
  • ArgResolutionLimitExceeded: 40 bytes
  • BubbleArgLimitExceeded: 40 bytes
  • ContractSizeLimitExceeded: 24 bytes
  • InitcodeSizeLimitExceeded: 24 bytes
  • InvalidOpcodeOperand: 32 bytes
  • OffsetExceedsTwoBytes: 40 bytes