Error

Enum Error 

Source
pub enum Error {
Show 50 variants UndefinedName { name: String, span: SourceSpan, }, DuplicateName { name: String, span: SourceSpan, previous: SourceSpan, }, DuplicateInterfaceExport { name: String, interface_name: Option<String>, span: SourceSpan, }, DuplicateWorldItem { kind: ExternKind, name: String, world: String, span: SourceSpan, }, NotFuncOrInterface { name: String, kind: String, span: SourceSpan, }, NotInterface { name: String, kind: String, span: SourceSpan, }, DuplicateWorldIncludeName { name: String, span: SourceSpan, }, NotWorld { name: String, kind: String, span: SourceSpan, }, MissingWorldInclude { world: String, name: String, span: SourceSpan, }, WorldIncludeConflict { kind: ExternKind, name: String, from: String, to: String, span: SourceSpan, help: Option<String>, }, UndefinedInterfaceType { name: String, interface_name: String, span: SourceSpan, }, NotInterfaceValueType { name: String, kind: String, interface_name: String, span: SourceSpan, }, DuplicateResourceConstructor { resource: String, span: SourceSpan, }, DuplicateResourceMethod { name: String, resource: String, span: SourceSpan, }, DuplicateVariantCase { case: String, name: String, span: SourceSpan, }, DuplicateRecordField { field: String, name: String, span: SourceSpan, }, DuplicateEnumCase { case: String, name: String, span: SourceSpan, }, DuplicateFlag { flag: String, name: String, span: SourceSpan, }, InvalidAliasType { name: String, kind: String, span: SourceSpan, }, NotFuncType { name: String, kind: String, span: SourceSpan, }, NotResourceType { name: String, kind: String, span: SourceSpan, }, NotValueType { name: String, kind: String, span: SourceSpan, }, DuplicateParameter { name: String, kind: FuncKind, span: SourceSpan, }, DuplicateResult { name: String, kind: FuncKind, span: SourceSpan, }, BorrowInResult { span: SourceSpan, }, UnknownPackage { name: String, span: SourceSpan, }, PackageParseFailure { name: String, span: SourceSpan, source: Error, }, PackageMissingExport { package: String, export: String, kind: Option<String>, path: String, span: SourceSpan, }, PackagePathMissingExport { name: String, kind: String, export: String, span: SourceSpan, }, MissingComponentImport { package: String, import: String, span: SourceSpan, }, MismatchedInstantiationArg { name: String, span: SourceSpan, source: Error, }, DuplicateInstantiationArg { name: String, span: SourceSpan, }, MissingInstantiationArg { name: String, package: String, span: SourceSpan, }, ImportConflict { name: String, package: PackageKey, import: SourceSpan, instantiation: SourceSpan, }, InstantiationArgMergeFailure { name: String, span: SourceSpan, instantiation: SourceSpan, source: Error, }, NotAnInstance { kind: String, operation: InstanceOperation, span: SourceSpan, }, MissingInstanceExport { name: String, span: SourceSpan, }, ExportRequiresAs { span: SourceSpan, }, DeclarationConflict { name: String, span: SourceSpan, export: SourceSpan, }, ExportConflict { name: String, kind: String, span: SourceSpan, definition: SourceSpan, help: Option<String>, }, DuplicateExternName { name: String, kind: ExternKind, span: SourceSpan, previous: SourceSpan, help: Option<String>, }, InvalidExternName { name: String, kind: ExternKind, span: SourceSpan, source: Error, }, UseConflict { name: String, kind: ExternKind, span: SourceSpan, help: Option<String>, }, FillArgumentNotLast { span: SourceSpan, }, SpreadInstantiationNoMatch { span: SourceSpan, }, SpreadExportNoEffect { span: SourceSpan, }, ImportNotInTarget { name: String, world: String, span: Option<SourceSpan>, }, MissingTargetExport { name: String, kind: String, world: String, span: SourceSpan, }, TargetMismatch { kind: ExternKind, name: String, world: String, span: Option<SourceSpan>, source: Error, }, ValidationFailure { source: BinaryReaderError, },
}
Expand description

Represents a resolution error.

Variants§

§

UndefinedName

An undefined name was encountered.

Fields

§name: String

The name that was undefined.

§span: SourceSpan

The span where the error occurred.

§

DuplicateName

A duplicate name was encountered.

Fields

§name: String

The duplicate name.

§span: SourceSpan

The span where the error occurred.

§previous: SourceSpan

The span where the name was previously defined.

§

DuplicateInterfaceExport

Duplicate interface export.

Fields

§name: String

The name of the duplicate export.

§interface_name: Option<String>

The name of the interface.

§span: SourceSpan

The span where the error occurred.

§

DuplicateWorldItem

Duplicate world item.

Fields

§kind: ExternKind

The extern kind of the item.

§name: String

The name of the item.

§world: String

The name of the world.

§span: SourceSpan

The span where the error occurred.

§

NotFuncOrInterface

The name is not a function type or interface.

Fields

§name: String

The name that is not a function type or interface.

§kind: String

The kind of the item.

§span: SourceSpan

The span where the error occurred.

§

NotInterface

The name is not an interface.

Fields

§name: String

The name that is not an interface.

§kind: String

The kind of the item.

§span: SourceSpan

The span where the error occurred.

§

DuplicateWorldIncludeName

Duplicate name in a world include.

Fields

§name: String

The name of the duplicate include.

§span: SourceSpan

The span where the error occurred.

§

NotWorld

The name is not a world.

Fields

§name: String

The name that is not a world.

§kind: String

The kind of the item.

§span: SourceSpan

The span where the error occurred.

§

MissingWorldInclude

Missing source item for with clause in world include.

Fields

§world: String

The name of the world.

§name: String

The name of the missing item.

§span: SourceSpan

The span where the error occurred.

§

WorldIncludeConflict

A conflict was encountered in a world include.

Fields

§kind: ExternKind

The extern kind of the item.

§name: String

The name of the item.

§from: String

The name of the source world.

§to: String

The name of the target world.

§span: SourceSpan

The span where the error occurred.

§help: Option<String>

The help for the error.

§

UndefinedInterfaceType

A name is not a type defined in an interface.

Fields

§name: String

The name of the type.

§interface_name: String

The name of the interface.

§span: SourceSpan

The span where the error occurred.

§

NotInterfaceValueType

A name is not a value type defined in an interface.

Fields

§name: String

The name that is not a value type.

§kind: String

The kind of the item.

§interface_name: String

The name of the interface.

§span: SourceSpan

The span where the error occurred.

§

DuplicateResourceConstructor

A duplicate resource constructor was encountered.

Fields

§resource: String

The name of the resource.

§span: SourceSpan

The span where the error occurred.

§

DuplicateResourceMethod

A duplicate resource method was encountered.

Fields

§name: String

The name of the method.

§resource: String

The name of the resource.

§span: SourceSpan

The span where the error occurred.

§

DuplicateVariantCase

A duplicate variant case was encountered.

Fields

§case: String

The name of the case.

§name: String

The name of the variant type.

§span: SourceSpan

The span where the error occurred.

§

DuplicateRecordField

A duplicate record field was encountered.

Fields

§field: String

The name of the field.

§name: String

The name of the record type.

§span: SourceSpan

The span where the error occurred.

§

DuplicateEnumCase

A duplicate enum case was encountered.

Fields

§case: String

The name of the case.

§name: String

The name of the enum type.

§span: SourceSpan

The span where the error occurred.

§

DuplicateFlag

A duplicate flag was encountered.

Fields

§flag: String

The name of the flag.

§name: String

The name of the flags type.

§span: SourceSpan

The span where the error occurred.

§

InvalidAliasType

The name cannot be used as an alias type.

Fields

§name: String

The name that cannot be used as an alias type.

§kind: String

The kind of the item.

§span: SourceSpan

The span where the error occurred.

§

NotFuncType

The name is not a function type.

Fields

§name: String

The name that is not a function type.

§kind: String

The kind of the item.

§span: SourceSpan

The span where the error occurred.

§

NotResourceType

The name is not a resource type.

Fields

§name: String

The name that is not a resource type.

§kind: String

The kind of the item.

§span: SourceSpan

The span where the error occurred.

§

NotValueType

The name is not a value type.

Fields

§name: String

The name that is not a value type.

§kind: String

The kind of the item.

§span: SourceSpan

The span where the error occurred.

§

DuplicateParameter

A duplicate function parameter was encountered.

Fields

§name: String

The name of the parameter.

§kind: FuncKind

The kind of the function.

§span: SourceSpan

The span where the error occurred.

§

DuplicateResult

A duplicate result was encountered.

Fields

§name: String

The name of the result.

§kind: FuncKind

The kind of the function.

§span: SourceSpan

The span where the error occurred.

§

BorrowInResult

A borrow type was encountered in a function result.

Fields

§span: SourceSpan

The span where the error occurred.

§

UnknownPackage

An unknown package was encountered.

Fields

§name: String

The name of the package.

§span: SourceSpan

The span where the error occurred.

§

PackageParseFailure

A package failed to parse.

Fields

§name: String

The name of the package.

§span: SourceSpan

The span where the error occurred.

§source: Error

The underlying error.

§

PackageMissingExport

A package is missing an export.

Fields

§package: String

The package missing the export.

§export: String

The name of the missing export.

§kind: Option<String>

The kind of the item missing the export.

§path: String

The path to the item missing the export.

§span: SourceSpan

The span where the error occurred.

§

PackagePathMissingExport

A missing export in a package path was encountered.

Fields

§name: String

The name that has no matching export.

§kind: String

The kind of the item.

§export: String

The name of the export.

§span: SourceSpan

The span where the error occurred.

§

MissingComponentImport

A missing import on a component was encountered.

Fields

§package: String

The name of the package.

§import: String

The name of the import.

§span: SourceSpan

The span where the error occurred.

§

MismatchedInstantiationArg

A mismatched instantiation argument was encountered.

Fields

§name: String

The name of the argument.

§span: SourceSpan

The span where the error occurred.

§source: Error

The source of the error.

§

DuplicateInstantiationArg

A duplicate instantiation argument was encountered.

Fields

§name: String

The name of the argument.

§span: SourceSpan

The span where the error occurred.

§

MissingInstantiationArg

A missing instantiation argument was encountered.

Fields

§name: String

The name of the argument.

§package: String

The name of the package.

§span: SourceSpan

The span where the error occurred.

§

ImportConflict

An explicitly imported item conflicts with an item that was implicitly imported from an instantiation.

Fields

§name: String

The name of the argument.

§package: PackageKey

The package that first introduced the import.

§import: SourceSpan

The span of the conflicting import.

§instantiation: SourceSpan

The span of the conflicting instantiation.

§

InstantiationArgMergeFailure

An instantiation argument conflict was encountered.

Fields

§name: String

The name of the argument.

§span: SourceSpan

The span where the error occurred.

§instantiation: SourceSpan

The span where the previous instantiation occurred.

§source: Error

The underlying merge error.

§

NotAnInstance

An operation was performed on something that was not an instance.

Fields

§kind: String

The kind of item that was not an instance.

§operation: InstanceOperation

The operation that was performed.

§span: SourceSpan

The span where the error occurred.

§

MissingInstanceExport

An instance is missing an export.

Fields

§name: String

The name of the export.

§span: SourceSpan

The span where the error occurred.

§

ExportRequiresAs

An export requires an `as`` clause.

Fields

§span: SourceSpan

The span where the error occurred.

§

DeclarationConflict

A type declaration conflicts with an export of the same name

Fields

§name: String

The name of the type.

§span: SourceSpan

The span where the error occurred.

§export: SourceSpan

The span of the previous export.

§

ExportConflict

An export conflicts with a definition.

Fields

§name: String

The name of the export.

§kind: String

The kind of the definition.

§span: SourceSpan

The span where the error occurred.

§definition: SourceSpan

The span of the previous definition.

§help: Option<String>

The help of the error.

§

DuplicateExternName

A duplicate extern name was encountered.

Fields

§name: String

The name of the export.

§kind: ExternKind

The kind of extern name.

§span: SourceSpan

The span where the error occurred.

§previous: SourceSpan

The span where the error occurred.

§help: Option<String>

The help of the error.

§

InvalidExternName

An invalid extern name was encountered.

Fields

§name: String

The name of the export.

§kind: ExternKind

The kind of extern.

§span: SourceSpan

The span where the error occurred.

§source: Error

The underlying validation error.

§

UseConflict

A use of a type conflicts with an extern item.

Fields

§name: String

The name of the used type.

§kind: ExternKind

The extern kind of the conflicting item.

§span: SourceSpan

The span where the error occurred.

§help: Option<String>

The help message for the error.

§

FillArgumentNotLast

A fill argument (...) was not the last argument.

Fields

§span: SourceSpan

The span where the error occurred.

§

SpreadInstantiationNoMatch

A spread instantiation argument did not match any import names.

Fields

§span: SourceSpan

The span where the error occurred.

§

SpreadExportNoEffect

An export spread operation was performed and had no effect.

Fields

§span: SourceSpan

The span where the error occurred.

§

ImportNotInTarget

An import is not in the target world.

Fields

§name: String

The import name.

§world: String

The target world.

§span: Option<SourceSpan>

The span where the error occurred.

§

MissingTargetExport

Missing an export for the target world.

Fields

§name: String

The export name.

§kind: String

The expected item kind.

§world: String

The target world.

§span: SourceSpan

The span where the error occurred.

§

TargetMismatch

An import or export has a mismatched type for the target world.

Fields

§kind: ExternKind

The kind of mismatch.

§name: String

The mismatched extern name.

§world: String

The target world.

§span: Option<SourceSpan>

The span where the error occurred.

§source: Error

The source of the error.

§

ValidationFailure

The encoding of the graph failed validation.

Fields

§source: BinaryReaderError

The source of the validation error.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Diagnostic for Error

Source§

fn code(&self) -> Option<Box<dyn Display + '_>>

Unique diagnostic code that can be used to look up more information about this Diagnostic. Ideally also globally unique, and documented in the toplevel crate’s documentation for easy searching. Rust path format (foo::bar::baz) is recommended, but more classic codes like E0123 or enums will work just fine.
Source§

fn help(&self) -> Option<Box<dyn Display + '_>>

Additional help text related to this Diagnostic. Do you have any advice for the poor soul who’s just run into this issue?
Source§

fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>

Labels to apply to this Diagnostic’s Diagnostic::source_code
Source§

fn severity(&self) -> Option<Severity>

Diagnostic severity. This may be used by ReportHandlers to change the display format of this diagnostic. Read more
Source§

fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>

URL to visit for a more detailed explanation/help about this Diagnostic.
Source§

fn source_code(&self) -> Option<&dyn SourceCode>

Source code to apply this Diagnostic’s Diagnostic::labels to.
Source§

fn related<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>>

Additional related Diagnostics.
Source§

fn diagnostic_source(&self) -> Option<&dyn Diagnostic>

The cause of the error.
Source§

impl Display for Error

Source§

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

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

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T> ErasedDestructor for T
where T: 'static,