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
symbol: SymbolThe 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: FeatureNameThe 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: ElementNameThe element whose declaration refers to the package.
owner: FeatureNameThe 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.
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
SpecialsWithNames
A special character sequence declaration lists command names. It may list none: its trigger is how it is written.
SynthesizedWithNames
A declaration with no syntax (SyntaxDef::Synthesized) lists command
names. It may list none, since nothing in the source writes it.
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.
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
owner: FeatureNameThe feature declaring it twice.
NoNames
A macro or environment declaration lists no name, so nothing can be registered for it.
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: FeatureNameThe declaring feature.
callable: ElementNameThe element whose declaration holds the argument.
index: usizeThe 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: FeatureNameThe declaring feature.
callable: ElementNameThe element whose declaration holds the argument.
index: usizeThe 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: FeatureNameThe declaring feature.
callable: ElementNameThe element whose declaration holds the tack-on argument.
index: usizeThe 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.
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: FeatureNameThe feature declaring the scoped package.
element: ElementNameThe 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.
Trait Implementations§
impl Eq for MintError
Source§impl Error for MintError
impl Error for MintError
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()
impl StructuralPartialEq for MintError
Auto Trait Implementations§
impl Forget for MintError
impl Freeze for MintErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Mode>: Freeze,
PhantomData<FeatureName>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const [Vec<FeatureName>] is !null: Freeze,
PhantomData<[Vec<FeatureName>]>: Freeze,
PhantomData<Name>: Freeze,
impl Move for MintError
impl RefUnwindSafe for MintError
impl Send for MintError
impl Sync for MintError
impl Unpin for MintError
impl UnsafeUnpin for MintErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Mode>: UnsafeUnpin,
PhantomData<FeatureName>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const [Vec<FeatureName>] is !null: UnsafeUnpin,
PhantomData<[Vec<FeatureName>]>: UnsafeUnpin,
PhantomData<Name>: UnsafeUnpin,
impl UnwindSafe for MintError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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