[][src]Enum rune::CompileError

pub enum CompileError {
    Internal {
        msg: &'static str,
        span: Span,
    },
    UnitError {
        error: UnitError,
    },
    ParseError {
        error: ParseError,
    },
    ItemConflict {
        span: Span,
        existing: Item,
    },
    VariableConflict {
        span: Span,
        name: String,
        existing_span: Span,
    },
    MissingLocal {
        span: Span,
        name: String,
    },
    MissingType {
        span: Span,
        item: Item,
    },
    MissingModule {
        span: Span,
        item: Item,
    },
    MissingLabel {
        span: Span,
    },
    UnsupportedWildcard {
        span: Span,
    },
    UnsupportedInstanceFunction {
        span: Span,
        meta: Meta,
    },
    UnsupportedValue {
        span: Span,
        meta: Meta,
    },
    UnsupportedType {
        span: Span,
        meta: Meta,
    },
    UnsupportedSelf {
        span: Span,
    },
    UnsupportedUnaryOp {
        span: Span,
        op: UnaryOp,
    },
    UnsupportedBinaryOp {
        span: Span,
        op: BinOp,
    },
    UnsupportedLitObject {
        span: Span,
        item: Item,
    },
    LitObjectMissingField {
        span: Span,
        field: String,
        item: Item,
    },
    LitObjectNotField {
        span: Span,
        field: String,
        item: Item,
    },
    UnsupportedAssignExpr {
        span: Span,
    },
    UnsupportedAssignBinOp {
        span: Span,
        op: BinOp,
    },
    UnsupportedRef {
        span: Span,
    },
    UnsupportedAwait {
        span: Span,
    },
    UnsupportedSelectPattern {
        span: Span,
    },
    UnsupportedFieldAccess {
        span: Span,
    },
    UnsupportedArgumentCount {
        span: Span,
        meta: Meta,
        expected: usize,
        actual: usize,
    },
    UnsupportedMetaPattern {
        meta: Meta,
        span: Span,
    },
    UnsupportedMetaClosure {
        meta: Meta,
        span: Span,
    },
    UnsupportedPattern {
        span: Span,
    },
    UnsupportedBinding {
        span: Span,
    },
    BreakOutsideOfLoop {
        span: Span,
    },
    ReturnLocalReferences {
        block: Span,
        span: Span,
        references_at: Vec<Span>,
    },
    MatchFloatInPattern {
        span: Span,
    },
    DuplicateObjectKey {
        span: Span,
        existing: Span,
        object: Span,
    },
    MissingFunction {
        span: Span,
        item: Item,
    },
    YieldOutsideFunction {
        span: Span,
    },
    AwaitOutsideFunction {
        span: Span,
    },
    InstanceFunctionOutsideImpl {
        span: Span,
    },
    UnsupportedAsyncGenerator {
        span: Span,
    },
    MissingPreludeModule {
        item: Item,
    },
}

Error when encoding AST.

Variants

Internal

An internal encoder invariant was broken.

Fields of Internal

msg: &'static str

The message of the variant.

span: Span

Where the invariant was broken.

UnitError

Unit error from runestick encoding.

Fields of UnitError

error: UnitError

Source error.

ParseError

Error for resolving values from source files.

Fields of ParseError

error: ParseError

Source error.

ItemConflict

Error when trying to index a duplicate item.

Fields of ItemConflict

span: Span

Where the conflicting item was found.

existing: Item

The name of the conflicting item.

VariableConflict

Error for variable conflicts.

Fields of VariableConflict

span: Span

Span where the error occured.

name: String

Name of the conflicting variable.

existing_span: Span

The span where the variable was already present.

MissingLocal

Error for missing local variables.

Fields of MissingLocal

span: Span

Span where the error occured.

name: String

Name of the missing variable.

MissingType

Error for missing types.

Fields of MissingType

span: Span

Span where the error occured.

item: Item

Name of the missing type.

MissingModule

Tried to use a module that was missing.

Fields of MissingModule

span: Span

The span of the missing module.

item: Item

The name of the missing module.

MissingLabel

A specific label is missing.

Fields of MissingLabel

span: Span

The span of the missing label.

UnsupportedWildcard

Unsupported wildcard component in use.

Fields of UnsupportedWildcard

span: Span

Where the wildcard import is.

UnsupportedInstanceFunction

Tried to declare an instance function on a type for which it is not supported.

Fields of UnsupportedInstanceFunction

span: Span

The span where we tried to declare an instance function.

meta: Meta

The meta we tried to declare an instance function for.

UnsupportedValue

Tried to treat something as a value which is not supported.

Fields of UnsupportedValue

span: Span

The span of the error.

meta: Meta

The meta we tried to treat as a value.

UnsupportedType

Tried to treat something as a type which is not supported.

Fields of UnsupportedType

span: Span

The span of the error.

meta: Meta

The meta we tried to treat as a type.

UnsupportedSelf

self occured in an unsupported position.

Fields of UnsupportedSelf

span: Span

Where it occured.

UnsupportedUnaryOp

Encountered a unary operator we can't encode.

Fields of UnsupportedUnaryOp

span: Span

The span of the illegal operator use.

op: UnaryOp

The operator.

UnsupportedBinaryOp

Encountered a binary operator we can't encode.

Fields of UnsupportedBinaryOp

span: Span

The span of the illegal call.

op: BinOp

The operator.

UnsupportedLitObject

Cannot crate object literal of the given type.

Fields of UnsupportedLitObject

span: Span

The span of the unsupported object.

item: Item

The path to the unsupported object.

LitObjectMissingField

Key is not present in the given type literal.

Fields of LitObjectMissingField

span: Span

The span of the unsupported object.

field: String

They key that didn't exist.

item: Item

The related item.

LitObjectNotField

Key is not present in the given type literal.

Fields of LitObjectNotField

span: Span

The span of the unsupported object.

field: String

They key that is not a field.

item: Item

The related item.

UnsupportedAssignExpr

When we encounter an expression that cannot be assigned to.

Fields of UnsupportedAssignExpr

span: Span

The thing being assigned to.

UnsupportedAssignBinOp

Unsupported assignment operator.

Fields of UnsupportedAssignBinOp

span: Span

The assign expression.

op: BinOp

The unsupported operator.

UnsupportedRef

When we encounter an expression that doesn't have a stack location and can't be referenced.

Fields of UnsupportedRef

span: Span

The thing we are taking the reference of.

UnsupportedAwait

Await has been used in a position where it's not supported.

Fields of UnsupportedAwait

span: Span

The location of the await.

UnsupportedSelectPattern

Using a pattern that is not supported in a select.

Fields of UnsupportedSelectPattern

span: Span

The span of the pattern.

UnsupportedFieldAccess

Unsupported field access.

Fields of UnsupportedFieldAccess

span: Span

The field access expression.

UnsupportedArgumentCount

A meta item that is not supported in the given pattern position.

Fields of UnsupportedArgumentCount

span: Span

The span which the error occured.

meta: Meta

The meta item we tried to use as a pattern.

expected: usize

The expected number of arguments.

actual: usize

The actual number of arguments.

UnsupportedMetaPattern

A meta item that is not supported in the given pattern position.

Fields of UnsupportedMetaPattern

meta: Meta

The meta item we tried to use as a pattern.

span: Span

The span which the error occured.

UnsupportedMetaClosure

A meta item that is not supported in the given closure position.

Fields of UnsupportedMetaClosure

meta: Meta

The meta item we tried to use as a pattern.

span: Span

The span which the error occured.

UnsupportedPattern

The pattern is not supported.

Fields of UnsupportedPattern

span: Span

Span where the error occured.

UnsupportedBinding

The pattern is not supported as a binding.

Fields of UnsupportedBinding

span: Span

Span where the error occured.

BreakOutsideOfLoop

Error raised when trying to use a break outside of a loop.

Fields of BreakOutsideOfLoop

span: Span

The span of the illegal break.

ReturnLocalReferences

An error raised when attempting to return locally created references from a function.

Fields of ReturnLocalReferences

block: Span

The span which we try to return from.

span: Span

The span at which we tried to return.

references_at: Vec<Span>

The references we tried to return.

MatchFloatInPattern

Attempting to use a float in a match pattern.

Fields of MatchFloatInPattern

span: Span

Where the float was used.

DuplicateObjectKey

Attempting to create an object with a duplicate object key.

Fields of DuplicateObjectKey

span: Span

Where the key was re-defined.

existing: Span

Where the object key exists previously.

object: Span

The object being defined.

MissingFunction

Attempt to call something that is not a function.

Fields of MissingFunction

span: Span

The span of the unsupported function call.

item: Item

The item we're trying to call.

YieldOutsideFunction

Attempt to yield outside of a function or a closure.

Fields of YieldOutsideFunction

span: Span

The span of the unsupported yield.

AwaitOutsideFunction

Attempt to await outside of a function or a closure.

Fields of AwaitOutsideFunction

span: Span

The span of the unsupported await.

InstanceFunctionOutsideImpl

Attempt to declare a function which takes self outside of an impl block.

Fields of InstanceFunctionOutsideImpl

span: Span

Where the function is declared.

UnsupportedAsyncGenerator

Attempt to declare an async function with yield.

Fields of UnsupportedAsyncGenerator

span: Span

The span of the async generator.

MissingPreludeModule

Import doesn't exist.

Fields of MissingPreludeModule

item: Item

The item that didn't exist.

Implementations

impl CompileError[src]

pub fn internal(msg: &'static str, span: Span) -> Self[src]

Construct an internal error.

This should be used for programming invariants of the encoder which are broken for some reason.

impl CompileError[src]

pub fn span(&self) -> Span[src]

Get the span for the error.

Trait Implementations

impl Debug for CompileError[src]

impl Display for CompileError[src]

impl Error for CompileError[src]

impl From<CompileError> for Error[src]

impl From<ParseError> for CompileError[src]

impl From<UnitError> for CompileError[src]

Auto Trait Implementations

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> ToString for T where
    T: Display + ?Sized
[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.

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