#[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
Help
-h
, --help
Display help message.
Cfg
--cfg SPEC
Configure the compilation environment.
LibrarySearchPath
-L [KIND=]PATH
Add a directory to the library search path.
Link
-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
modifiers: Vec<(LinkModifierPrefix, LinkModifier)>
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.
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.
ExternLocation
--extern-location NAME=LOCATION
Location where an external crate dependency is specified.
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).