Enum rustflags::Flag

source ·
#[non_exhaustive]
pub enum Flag {
Show 31 variants Help, Cfg { name: String, value: Option<String>, }, LibrarySearchPath { kind: LibraryKind, path: PathBuf, }, Link { kind: LinkKind, modifiers: Vec<(LinkModifierPrefix, LinkModifier)>, name: String, rename: Option<String>, }, CrateType(CrateType), CrateName(String), Edition(u16), Emit(Emit), Print(String), Out(PathBuf), OutDir(PathBuf), Explain(String), Test, Target(String), Allow(String), Warn(String), ForceWarn(String), Deny(String), Forbid(String), CapLints(LintLevel), Codegen { opt: String, value: Option<String>, }, Version, Verbose, Extern { name: String, path: Option<PathBuf>, }, ExternLocation { name: String, location: OsString, }, Sysroot(PathBuf), Z(String), ErrorFormat(ErrorFormat), Json(String), Color(Color), RemapPathPrefix { from: PathBuf, to: PathBuf, },
}
Expand description

One flag recognized by rustc

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Help

-h, --help

Display help message.

§

Cfg

--cfg SPEC

Configure the compilation environment.

Fields

§name: String
§

LibrarySearchPath

-L [KIND=]PATH

Add a directory to the library search path.

Fields

§path: PathBuf

-l [KIND[:MODIFIERS]=]NAME[:RENAME]

Link the generated crate(s) to the specified native library NAME. Optional comma separated MODIFIERS may be specified each with a prefix of either ‘+’ to enable or ‘-’ to disable.

Fields

§name: String
§rename: Option<String>
§

CrateType(CrateType)

--crate-type [bin|lib|rlib|dylib|cdylib|staticlib|proc-macro]

Comma separated list of types of crates for the compiler to emit.

§

CrateName(String)

--crate-name NAME

Specify the name of the crate being built.

§

Edition(u16)

--edition 2015|2018|2021

Specify which edition of the compiler to use when compiling code.

§

Emit(Emit)

--emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]

Comma separated list of types of output for the compiler to emit.

§

Print(String)

--print [crate-name|file-names|sysroot|target-libdir|cfg|target-list|target-cpus|target-features|relocation-models|code-models|tls-models|target-spec-json|native-static-libs|stack-protector-strategies]

Compiler information to print on stdout.

§

Out(PathBuf)

-o FILENAME

Write output to <filename>.

§

OutDir(PathBuf)

--out-dir DIR

Write output to compiler-chosen filename in <dir>.

§

Explain(String)

--explain OPT

Provide a detailed explanation of an error message.

§

Test

--test

Build a test harness.

§

Target(String)

--target TARGET

Target triple for which the code is compiled.

§

Allow(String)

-A, --allow LINT

Set lint allowed.

§

Warn(String)

-W, --warn LINT

Set lint warnings.

§

ForceWarn(String)

--force-warn LINT

Set lint force-warn.

§

Deny(String)

-D, --deny LINT

Set lint denied.

§

Forbid(String)

-F, --forbid LINT

Set lint forbidden.

§

CapLints(LintLevel)

--cap-lints LEVEL

Set the most restrictive lint level. More restrictive lints are capped at this level.

§

Codegen

-C, --codegen OPT[=VALUE]

Set a codegen option.

Fields

§

Version

-V, --version

Print version info and exit.

§

Verbose

-v, --verbose

Use verbose output.

§

Extern

--extern NAME[=PATH]

Specify where an external rust library is located.

Fields

§name: String
§

ExternLocation

--extern-location NAME=LOCATION

Location where an external crate dependency is specified.

Fields

§name: String
§location: OsString
§

Sysroot(PathBuf)

--sysroot PATH

Override the system root.

§

Z(String)

-Z FLAG

Set internal debugging options.

§

ErrorFormat(ErrorFormat)

--error-format human|json|short

How errors and other messages are produced.

§

Json(String)

--json CONFIG

Configure the JSON output of the compiler.

§

Color(Color)

--color auto|always|never

Configure coloring of output.

§

RemapPathPrefix

--remap-path-prefix FROM=TO

Remap source names in all output (compiler messages and output files).

Fields

§from: PathBuf

Trait Implementations§

source§

impl Debug for Flag

source§

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

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

impl IntoIterator for Flag

§

type Item = OsString

The type of the elements being iterated over.
§

type IntoIter = Iter

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq for Flag

source§

fn eq(&self, other: &Flag) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Flag

Auto Trait Implementations§

§

impl Freeze for Flag

§

impl RefUnwindSafe for Flag

§

impl Send for Flag

§

impl Sync for Flag

§

impl Unpin for Flag

§

impl UnwindSafe for Flag

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> 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<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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.