Skip to main content

MintError

Enum MintError 

Source
pub enum MintError {
Show 13 variants Clash { kind: ClashKind, symbol: Symbol, modes: Vec<Mode>, owners: Vec<FeatureName>, winner: FeatureName, chains: Box<[Vec<FeatureName>]>, }, UnknownScopedPackage { element: ElementName, owner: FeatureName, argument: Option<usize>, field: Option<String>, package: Name, }, ScopedPackageCycle { packages: Vec<Name>, }, SpecialsWithNames { owner: FeatureName, trigger: String, }, SynthesizedWithNames { owner: FeatureName, element: ElementName, }, NoReferenceArgument { owner: FeatureName, element: ElementName, detail: String, }, Redeclared { symbol: Symbol, owner: FeatureName, modes: Vec<Mode>, }, NoNames { owner: FeatureName, element: ElementName, }, LayoutOnOpaqueWrappedArgument { owner: FeatureName, callable: ElementName, index: usize, field: Option<String>, }, BlocksOnMathArgument { owner: FeatureName, callable: ElementName, index: usize, field: Option<String>, }, FieldDeclaredTwice { owner: FeatureName, callable: ElementName, index: usize, field: Option<String>, name: String, }, WeakInScopedPackage { owner: FeatureName, package: Name, element: ElementName, }, LayoutOnOpaqueWrappedBody { owner: FeatureName, element: ElementName, },
}
Expand description

A problem with the declarations that minting found.

mint_packages collects every problem in MintedProviders::errors and still builds everything that is sound; each variant says what was found and, where a choice had to be made, which declaration applies. The language build reports each one as a LangBuildError::Mint, and the registry build refuses a language with any such error: it fails in its language phase (BuildPhase::Language). The userdefs feature, which mints a language for the templates of user definitions, reports these errors as diagnostics of those user definitions.

The Display text states the problem for the author of the feature or of the user definition; it identifies, where the problem concerns them, the declaring feature and the element by name.

Variants§

§

Clash

Two or more features declare the same thing where it matters. For a command name: two or more features define it in one parsing mode (ordinarily, or weakly where no feature defines it ordinarily in that mode), and the feature registered last among them in that mode is neither placed by the feature order explicitly after every other of them nor declares an override. There is one error per name and parsing mode.

Fields

§kind: ClashKind

What was declared twice.

§symbol: Symbol

The name concerned: the command name; for a fallback, the name of the callable kind; for a scoped package, the package’s name.

§modes: Vec<Mode>

The parsing modes in which the declarations overlap, in the modes’ fixed order: for a command name, the one mode concerned. Empty for a scoped package, which is not tied to parsing modes.

§owners: Vec<FeatureName>

Every feature whose declaration is available in one of modes, in registration order: for a command name, the features that declare it ordinarily in that mode, or those that declare it weakly when none declares it ordinarily.

§winner: FeatureName

The feature whose declaration applies despite the clash: for a command name the last of owners, since a later feature’s package shadows an earlier one’s; for a fallback or a scoped package the first, since a later overlapping one is not installed.

§chains: Box<[Vec<FeatureName>]>

For a command name, the chains of the feature order that settle the clash, each making the definition of its last feature apply. Each lists the other features of owners in registration order, then that feature. A chain is listed only when the explicit order in force places none of its features before an earlier one of the chain, so that adding it makes no cycle. Empty for a fallback or a scoped package, which no chain settles.

§

UnknownScopedPackage

An environment body or an argument refers to a scoped package that no feature declares and that the feature declaring the element did not declare as a peer. (A package declared as a peer that no feature declares makes nothing available and is reported by the registry build as a Note, not here.)

Fields

§element: ElementName

The element whose declaration refers to the package.

§owner: FeatureName

The feature declaring the element.

§argument: Option<usize>

None when the environment’s body refers to the package; the argument’s position, counting from zero, when an argument does, in the argument list that declares it: the element’s own, or that of the tack-on field given by field.

§field: Option<String>

The name of the tack-on field whose own argument list holds the argument; None when the argument is the element’s own.

§package: Name

The package name that was not found.

§

ScopedPackageCycle

Scoped packages refer to each other in a cycle, each through one of its declarations (an environment’s body or an argument), so there is no order in which each is built after the ones it refers to. Minting breaks the cycle at the reference that closes it.

Fields

§packages: Vec<Name>

The packages of the cycle, each referring to the next, the last to the first.

§

SpecialsWithNames

A special character sequence declaration lists command names. It may list none: its trigger is how it is written.

Fields

§owner: FeatureName

The declaring feature.

§trigger: String

The trigger of the declaration.

§

SynthesizedWithNames

A declaration with no syntax (SyntaxDef::Synthesized) lists command names. It may list none, since nothing in the source writes it.

Fields

§owner: FeatureName

The declaring feature.

§element: ElementName

The element concerned.

§

NoReferenceArgument

A file-inclusion macro (SyntaxDef::Inclusion) declares no argument named REFERENCE_ARGUMENT, so it has no argument to read the file’s reference from.

Fields

§owner: FeatureName

The declaring feature.

§element: ElementName

The element concerned.

§detail: String

A description of the declared arguments, such as “it declares no argument”.

§

Redeclared

One feature declares one command name twice in parsing modes that overlap, so in the overlapping modes only one of the two declarations could apply, whatever the weakness of the two (ElementDef::weak). Two declarations of one name whose modes do not overlap are sound and are built into two of the feature’s techy packages.

Fields

§symbol: Symbol

The name concerned.

§owner: FeatureName

The feature declaring it twice.

§modes: Vec<Mode>

The parsing modes both declarations are available in, in the modes’ fixed order.

§

NoNames

A macro or environment declaration lists no name, so nothing can be registered for it.

Fields

§owner: FeatureName

The declaring feature.

§element: ElementName

The element concerned.

§

LayoutOnOpaqueWrappedArgument

An argument declared with an opaque wrapper (ArgDef::opaque_wrapper) declares a layout other than ArgLayout::Inline. The block-structure pass carries the content of an opaque wrapper over as written, so the declaration could never take effect. The argument is built with the inline layout.

Fields

§owner: FeatureName

The declaring feature.

§callable: ElementName

The element whose declaration holds the argument.

§index: usize

The argument’s position, counting from zero, in the argument list that declares it: the element’s own, or that of the tack-on field given by field.

§field: Option<String>

The name of the tack-on field whose own argument list holds the argument; None when the argument is the element’s own.

§

BlocksOnMathArgument

An argument read in mathematics mode (ArgDef::mode) declares the layout ArgLayout::Blocks. The block-structure pass carries mathematics over untouched, so the declaration could never take effect. The argument is built with the inline layout.

Fields

§owner: FeatureName

The declaring feature.

§callable: ElementName

The element whose declaration holds the argument.

§index: usize

The argument’s position, counting from zero, in the argument list that declares it: the element’s own, or that of the tack-on field given by field.

§field: Option<String>

The name of the tack-on field whose own argument list holds the argument; None when the argument is the element’s own.

§

FieldDeclaredTwice

A tack-on argument declares two fields (TackOnField) of one name, so a macro of that name written after the command could be read as either. The second field is left out of the argument.

Fields

§owner: FeatureName

The declaring feature.

§callable: ElementName

The element whose declaration holds the tack-on argument.

§index: usize

The tack-on argument’s position, counting from zero, in the argument list that declares it: the element’s own, or that of the tack-on field given by field.

§field: Option<String>

The name of the tack-on field whose own argument list holds the tack-on argument; None when the argument is the element’s own.

§name: String

The name the two fields share.

§

WeakInScopedPackage

A declaration in a scoped package is marked weak (ElementDef::weak). A scoped package is placed on a scope stack by whoever adds it (a body, an argument or a program), above the features’ packages, so no place under the ordinary declarations exists for it. The declaration is built as an ordinary one.

Fields

§owner: FeatureName

The feature declaring the scoped package.

§package: Name

The scoped package.

§element: ElementName

The element of the weak declaration.

§

LayoutOnOpaqueWrappedBody

An environment’s body declared with an opaque wrapper (BodyDef::opaque_wrapper) declares a layout other than FromRole. The block-structure pass carries the content of an opaque wrapper over as written, so the declaration could never take effect.

Fields

§owner: FeatureName

The declaring feature.

§element: ElementName

The environment’s element.

Trait Implementations§

Source§

impl Clone for MintError

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 MintError

Source§

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

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

impl Display for MintError

Source§

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

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

impl Eq for MintError

Source§

impl Error for MintError

1.30.0 · 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

Replaced by Error::source.
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
Source§

impl PartialEq for MintError

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 MintError

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

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
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
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

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

Source§

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

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

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

Source§

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

Checks if this value is equivalent to the given key. 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> 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<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
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> 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 = !

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

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.