pub enum GraphcalError {
Show 112 variants
DuplicateName {
name: String,
src: NamedSource<Arc<String>>,
duplicate: SourceSpan,
first: SourceSpan,
},
BuiltinNameShadowed {
kind: &'static str,
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ConflictingImportedUnit {
name: UnitRef,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InvalidPlotProperty {
property: String,
context: &'static str,
valid: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
PlotPropertyTypeMismatch {
property: &'static str,
expected: &'static str,
found: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
PlotPropertyDimensioned {
property: &'static str,
dimension: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ImportPlotItem {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
HiddenIncludeItemNotAPlot {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownPlotReference {
owner_kind: &'static str,
owner: ScopedName,
name: ScopedName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
CompositionReferencesNonPlot {
owner_kind: &'static str,
actual_kind: &'static str,
name: ScopedName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
DuplicatePlotReference {
owner_kind: &'static str,
owner: ScopedName,
name: ScopedName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownGraphRef {
name: ScopedName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownConstRef {
name: ScopedName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownFunction {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
GraphRefInConst {
name: ScopedName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
GraphRefInConstUnit {
name: ScopedName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
NonConstUnitInConst {
name: UnitRef,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
GraphRefInFn {
name: ScopedName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
help: String,
},
RecursiveFunction {
name: FnName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
WrongArity {
name: FnName,
expected: usize,
got: usize,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
WrongGenericArity {
name: FnName,
expected: usize,
got: usize,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
GenericArgMismatch {
name: FnName,
param: String,
expected: String,
found: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
CyclicDependency {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
EvalError {
message: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InternalError {
message: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
DimensionOverflow {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
DimensionMismatch {
expected: String,
found: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
help: String,
},
IndexedShapeMismatch {
context: String,
lhs: String,
rhs: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
DimensionMismatchInAnnotation {
declared: String,
inferred: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownUnit {
name: UnitRef,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownDimension {
name: DimName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
CyclicDimension {
name: DimName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
CyclicUnit {
name: UnitName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
NonLiteralExponent {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ConversionDimensionMismatch {
target: String,
expr_dim: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
NestedConversion {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
IneffectiveConversion {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
AffineProneUnitDefinition {
dim: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownStructType {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownField {
type_name: StructTypeName,
field_name: FieldName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
MissingFields {
type_name: StructTypeName,
missing: Vec<FieldName>,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExtraFields {
type_name: StructTypeName,
extra: Vec<FieldName>,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
FieldDimensionMismatch {
type_name: StructTypeName,
field_name: FieldName,
expected: String,
found: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
NotAStruct {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownLocalRef {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownIndex {
name: IndexName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownVariant {
index_name: IndexName,
variant_name: IndexVariantName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
MissingVariants {
index_name: IndexName,
missing: Vec<IndexVariantName>,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExtraVariants {
index_name: IndexName,
extra: Vec<IndexVariantName>,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
IndexMismatch {
expected: IndexName,
found: IndexName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
FileNotFound {
path: String,
},
CircularImport {
cycle: String,
},
ImportFileNotFound {
path: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ImportNameNotFound {
name: String,
file_path: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InvalidModuleName {
stem: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
DuplicateModuleName {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
first: SourceSpan,
},
UnknownModule {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
QualifiedNameNotFound {
module: String,
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
RangeIndexDimensionMismatch {
name: IndexName,
start_dim: String,
end_dim: String,
step_dim: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
RangeIndexInvalid {
name: IndexName,
message: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
GraphRefToAssert {
name: DeclName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
AssertBodyNotBool {
found: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
AssumedAssertionFailed {
name: DeclName,
src: NamedSource<Arc<String>>,
span: SourceSpan,
help: String,
},
UnknownAssertInAssumes {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InvalidAssumesTarget {
kind: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InvalidHiddenTarget {
kind: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownAttribute {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InvalidExpectedFailTarget {
kind: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExpectedFailInvalidArg {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExpectedFailNotIndexed {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExpectedFailAllOnIndexed {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExpectedFailDuplicateKey {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExpectedFailKeyShapeMismatch {
expected: usize,
found: usize,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExpectedFailKeyIndexMismatch {
expected: String,
found: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ExpectedFailRangeStepOutOfBounds {
step: u64,
size: u64,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
NegativeTolerance {
found: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ImportOutsideRoot {
path: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
OverrideNotAParam {
name: DeclName,
actual_kind: DeclCategory,
},
OverrideUnknownParam {
name: DeclName,
},
RequiredParamNotProvided {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownParamBinding {
name: String,
file_path: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
BindingNotAParam {
name: String,
actual_kind: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InstantiatedImportNeedsNamespace {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
BareImportWithoutManifest {
path: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
PackageNameMismatch {
path_first: String,
package_name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
StdlibNotImplemented {
path: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ManifestError {
message: String,
},
CrossFileImportInVirtualPackage {
path: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
BindingTargetsIndex {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
IndexBindingNotAnIndex {
dep_index: String,
value: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
IndexKindMismatch {
dep_index: String,
dep_kind: String,
bound_index: String,
bound_kind: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
IndexBindingDimensionMismatch {
dep_index: String,
expected_dim: String,
bound_index: String,
found_dim: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
RequiredIndexNotBound {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ImportRuntimeItem {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InvalidTimezone {
timezone: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
DomainViolation {
name: String,
value: String,
violation: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
DomainDimensionMismatch {
name: String,
type_dim: String,
bound_name: String,
bound_dim: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
DomainMinExceedsMax {
name: String,
min: String,
max: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InvalidDomainTarget {
type_kind: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
IntDomainBoundNotUnitless {
name: String,
bound_name: String,
bound_type: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
GenericTypeArgDomainConstraint {
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
ImportPrivateItem {
name: String,
file_path: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
RequiredItemMustBeBindable {
kind: String,
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
PrivateInPublic {
pub_kind: String,
pub_name: String,
ref_kind: String,
ref_name: String,
src: NamedSource<Arc<String>>,
ref_span: SourceSpan,
pub_span: SourceSpan,
},
PubIndexVariantLiteral {
index: String,
variant: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
IncludeMustReconcileOverride {
overridden: String,
overridden_kind: String,
orphan_decl: String,
detail: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
GenericsLeakage {
reexport_kind: String,
reexport_name: String,
leaked_kind: String,
leaked_name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownDag {
name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownInlineDagParam {
name: String,
dag_name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
MissingInlineDagBindings {
missing: Vec<String>,
dag_name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
UnknownInlineDagOutput {
name: String,
dag_name: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
InlineDagArgDimensionMismatch {
param_name: String,
expected: String,
found: String,
src: NamedSource<Arc<String>>,
span: SourceSpan,
},
}Expand description
Rich diagnostic error types for graphcal evaluation.
Variants§
DuplicateName
BuiltinNameShadowed
ConflictingImportedUnit
InvalidPlotProperty
PlotPropertyTypeMismatch
PlotPropertyDimensioned
ImportPlotItem
HiddenIncludeItemNotAPlot
UnknownPlotReference
CompositionReferencesNonPlot
DuplicatePlotReference
UnknownGraphRef
UnknownConstRef
UnknownFunction
GraphRefInConst
GraphRefInConstUnit
NonConstUnitInConst
GraphRefInFn
RecursiveFunction
WrongArity
WrongGenericArity
GenericArgMismatch
CyclicDependency
EvalError
InternalError
An internal invariant violation that should never be reached if earlier
compiler phases (parsing, resolution, dim_check) are correct.
DimensionOverflow
DimensionMismatch
IndexedShapeMismatch
DimensionMismatchInAnnotation
UnknownUnit
UnknownDimension
CyclicDimension
CyclicUnit
NonLiteralExponent
ConversionDimensionMismatch
NestedConversion
IneffectiveConversion
AffineProneUnitDefinition
UnknownStructType
UnknownField
MissingFields
ExtraFields
FieldDimensionMismatch
NotAStruct
UnknownLocalRef
UnknownIndex
UnknownVariant
MissingVariants
ExtraVariants
IndexMismatch
FileNotFound
CircularImport
ImportFileNotFound
ImportNameNotFound
InvalidModuleName
DuplicateModuleName
UnknownModule
QualifiedNameNotFound
RangeIndexDimensionMismatch
RangeIndexInvalid
GraphRefToAssert
AssertBodyNotBool
AssumedAssertionFailed
UnknownAssertInAssumes
InvalidAssumesTarget
InvalidHiddenTarget
UnknownAttribute
InvalidExpectedFailTarget
ExpectedFailInvalidArg
ExpectedFailNotIndexed
ExpectedFailAllOnIndexed
ExpectedFailDuplicateKey
ExpectedFailKeyShapeMismatch
ExpectedFailKeyIndexMismatch
ExpectedFailRangeStepOutOfBounds
NegativeTolerance
ImportOutsideRoot
OverrideNotAParam
OverrideUnknownParam
RequiredParamNotProvided
UnknownParamBinding
BindingNotAParam
InstantiatedImportNeedsNamespace
BareImportWithoutManifest
PackageNameMismatch
StdlibNotImplemented
ManifestError
CrossFileImportInVirtualPackage
BindingTargetsIndex
IndexBindingNotAnIndex
IndexKindMismatch
IndexBindingDimensionMismatch
RequiredIndexNotBound
A required index was not bound via parameterized import.
Required indexes (index Foo;, index Foo: Time;) must be bound when the
file is imported. They cannot be evaluated standalone.
ImportRuntimeItem
InvalidTimezone
DomainViolation
DomainDimensionMismatch
DomainMinExceedsMax
InvalidDomainTarget
IntDomainBoundNotUnitless
GenericTypeArgDomainConstraint
ImportPrivateItem
Attempting to import a private (non-pub) item from another file.
RequiredItemMustBeBindable
A required index, type, or dim is not marked pub(bind).
param is excluded: required param is implicitly bindable (A5);
it never carries a visibility annotation.
PrivateInPublic
A visible declaration references a private type-system item in its written signature (A9 case 1).
The pub_kind string is the declaration kind (e.g. "param",
"pub node", "pub type"). param is always visible (A5 §4.0)
and never carries an explicit annotation.
PubIndexVariantLiteral
A pub(bind) index with concrete variants has its variants used
in a non-bindable body (node / const) or a public sink
declaration in the defining file.
Per axiom A10(c) / A10(b), a bindable index’s variant literals must not appear in bodies that cannot themselves be re-bound by importers (the defining library must abstract over the index).
IncludeMustReconcileOverride
An include overrides a bindable symbol s, but some kept
declaration’s body or default mentions a name nominally tied to
s and was not itself re-bound by the same include statement
(A8).
Nominally-tied mentions today are: variant literals s.v for
an overridden index, and constructors / field accesses of s
for an overridden type. dim and param overrides are
vacuous for A8 — their substitution is total — so they never
trigger this error.
GenericsLeakage
A pub include / pub import (or selective { pub items })
re-exports a declaration whose effective (post-substitution)
signature mentions a symbol that is V = private at the
importing site — A9 case 2 / visibility composition.
Concretely: an include binding renames a bindable symbol s
in the dep to a name that is private at the importer, and the
re-exported surface of the include carries that name into the
importer’s public API. Downstream consumers of the importer
would see a signature referring to a symbol they cannot name.
UnknownDag
UnknownInlineDagParam
MissingInlineDagBindings
UnknownInlineDagOutput
InlineDagArgDimensionMismatch
Implementations§
Source§impl GraphcalError
impl GraphcalError
Sourcepub const fn named_source(&self) -> Option<&NamedSource<Arc<String>>>
pub const fn named_source(&self) -> Option<&NamedSource<Arc<String>>>
Return the NamedSource embedded in this error, if any.
Most variants carry a #[source_code] field naming the file and its
full source text. Exposing it as a typed accessor lets diagnostic
emitters pair the error’s offsets with the exact source they index
into — instead of inferring (name, source) from external context,
which can silently desynchronize when an imported file is the origin.
Returns None for the handful of variants that represent errors
without a source location: file-system errors before parsing
(Self::FileNotFound, Self::CircularImport,
Self::ManifestError) and CLI override errors
(Self::OverrideNotAParam, Self::OverrideUnknownParam).
Trait Implementations§
Source§impl Clone for GraphcalError
impl Clone for GraphcalError
Source§fn clone(&self) -> GraphcalError
fn clone(&self) -> GraphcalError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphcalError
impl Debug for GraphcalError
Source§impl Diagnostic for GraphcalError
impl Diagnostic for GraphcalError
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_codeSource§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic’s Diagnostic::labels to.Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandlers 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.Diagnostics.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
Source§impl Display for GraphcalError
impl Display for GraphcalError
Source§impl Error for GraphcalError
impl Error for GraphcalError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()