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.
DuplicateName
A duplicate name was encountered.
Fields
span: SourceSpan
The span where the error occurred.
previous: SourceSpan
The span where the name was previously defined.
DuplicateInterfaceExport
Duplicate interface export.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateWorldItem
Duplicate world item.
Fields
kind: ExternKind
The extern kind of the item.
span: SourceSpan
The span where the error occurred.
NotFuncOrInterface
The name is not a function type or interface.
Fields
span: SourceSpan
The span where the error occurred.
NotInterface
The name is not an interface.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateWorldIncludeName
Duplicate name in a world include.
Fields
span: SourceSpan
The span where the error occurred.
NotWorld
The name is not a world.
Fields
span: SourceSpan
The span where the error occurred.
MissingWorldInclude
Missing source item for with
clause in world include.
Fields
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.
span: SourceSpan
The span where the error occurred.
UndefinedInterfaceType
A name is not a type defined in an interface.
Fields
span: SourceSpan
The span where the error occurred.
NotInterfaceValueType
A name is not a value type defined in an interface.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateResourceConstructor
A duplicate resource constructor was encountered.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateResourceMethod
A duplicate resource method was encountered.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateVariantCase
A duplicate variant case was encountered.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateRecordField
A duplicate record field was encountered.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateEnumCase
A duplicate enum case was encountered.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateFlag
A duplicate flag was encountered.
Fields
span: SourceSpan
The span where the error occurred.
InvalidAliasType
The name cannot be used as an alias type.
Fields
span: SourceSpan
The span where the error occurred.
NotFuncType
The name is not a function type.
Fields
span: SourceSpan
The span where the error occurred.
NotResourceType
The name is not a resource type.
Fields
span: SourceSpan
The span where the error occurred.
NotValueType
The name is not a value type.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateParameter
A duplicate function parameter was encountered.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateResult
A duplicate result was encountered.
Fields
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.
PackageParseFailure
A package failed to parse.
Fields
span: SourceSpan
The span where the error occurred.
PackageMissingExport
A package is missing an export.
Fields
span: SourceSpan
The span where the error occurred.
PackagePathMissingExport
A missing export in a package path was encountered.
Fields
span: SourceSpan
The span where the error occurred.
MissingComponentImport
A missing import on a component was encountered.
Fields
span: SourceSpan
The span where the error occurred.
MismatchedInstantiationArg
A mismatched instantiation argument was encountered.
Fields
span: SourceSpan
The span where the error occurred.
DuplicateInstantiationArg
A duplicate instantiation argument was encountered.
MissingInstantiationArg
A missing instantiation argument was encountered.
Fields
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
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
span: SourceSpan
The span where the error occurred.
instantiation: SourceSpan
The span where the previous instantiation occurred.
NotAnInstance
An operation was performed on something that was not an instance.
Fields
operation: InstanceOperation
The operation that was performed.
span: SourceSpan
The span where the error occurred.
MissingInstanceExport
An instance is missing an export.
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
span: SourceSpan
The span where the error occurred.
export: SourceSpan
The span of the previous export.
ExportConflict
An export conflicts with a definition.
Fields
span: SourceSpan
The span where the error occurred.
definition: SourceSpan
The span of the previous definition.
DuplicateExternName
A duplicate extern name was encountered.
Fields
kind: ExternKind
The kind of extern name.
span: SourceSpan
The span where the error occurred.
previous: SourceSpan
The span where the error occurred.
InvalidExternName
An invalid extern name was encountered.
UseConflict
A use of a type conflicts with an extern item.
Fields
kind: ExternKind
The extern kind of the conflicting item.
span: SourceSpan
The span where the error occurred.
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
span: Option<SourceSpan>
The span where the error occurred.
MissingTargetExport
Missing an export for the target world.
Fields
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.
span: Option<SourceSpan>
The span where the error occurred.
ValidationFailure
The encoding of the graph failed validation.
Fields
source: BinaryReaderError
The source of the validation error.
Trait Implementations§
Source§impl Diagnostic for Error
impl Diagnostic for Error
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
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 + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
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> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic
’s Diagnostic::source_code
Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandler
s to change the display format
of this diagnostic. Read moreSource§fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic
.Source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic
’s Diagnostic::labels
to.Diagnostic
s.