Compiler structv0.1.0

Source
Properties of the compiler performing the build.
pub struct Compiler {
    pub version: SemanticVersion;
}

Fixed when compiling begins. Reading a field produces no runtime code.

Fields

NameTypeDescription
versionSemanticVersionThe compiler's own version.

Methods

HasFeature

pub func HasFeature(
    self: &Compiler,
    feature: char8[..]
) -> bool

Whether this compiler provides the named language or library feature. self is borrowed and feature must be a string literal, since this is answered while compiling. Prefer it to comparing version: a feature name says what the code needs, and stays right when the feature arrives in a release the comparison did not anticipate. Cannot fail: an unknown name is absent rather than an error. Costs nothing in the built program.

NameTypeDescription
featurechar8[..]the feature's name

Returns: whether this compiler reports that feature

Source

#compiler

pub const #compiler: Compiler;

The compiler performing the build, as a compile-time value.

Source