Expand description
Contains infrastructure for configuring the compiler, including parsing command-line options.
Modules§
- cfg π
- cfg and check-cfg configuration
- dep_
tracking π - Command-line arguments passed to the compiler have to be incorporated with the dependency tracking system for incremental compilation. This module provides some utilities to make this more convenient.
- native_
libs π - Parser for the
-l
command-line option, which links the generated crate to a native library. - nightly_
options - parse
- sigpipe
- NOTE: Keep these constants in sync with
library/std/src/sys/pal/unix/mod.rs
!
Structs§
- Branch
Protection - Check
Cfg - The parsed
--check-cfg
options. - Codegen
Options - Coverage
Options - Individual flag values controlled by
-Zcoverage-options
. - Extended
Target Modifier Info - Extended target modifier info. For example, when external target modifier is β-Zregparm=2β: Target modifier enum value + user value (β2β) from external crate is converted into description: prefix (βZβ), name (βregparmβ), tech value (βSome(2)β).
- Extern
Entry - Externs
- Use tree-based collections to cheaply get a deterministic
Hash
implementation. Do not switchBTreeMap
orBTreeSet
out for an unsorted container type! That would break dependency tracking for command-line arguments. - InstrumentX
Ray - Settings for
-Z instrument-xray
flag. - Json
Config - Possible json config files
- Link
Self Contained - The different values
-C link-self-contained
can take: a list of individually enabled or disabled components used during linking, coming from the rustc distribution, instead of being found somewhere on the host system. - Linker
Features Cli - The different values that
-Z linker-features
can take on the CLI: a list of individually enabled or disabled features used during linking. - Location
Detail - The different settings that can be enabled via the
-Z location-detail
flag. - Next
Solver Config - Option
Desc - Options
- The top-level command-line options struct.
- Output
Filenames - Output
Types - Use tree-based collections to cheaply get a deterministic
Hash
implementation. Do not switchBTreeMap
out for an unsorted container type! That would break dependency tracking for command-line arguments. Also only hash keys, since tracking should only depend on the output types, not the paths theyβre written to. - PacRet
- Patchable
Function Entry -Z patchable-function-entry
representation - how many nops to put before and after function entry.- Print
Request - Remap
Path Scope Components - Scopes used to determined if it need to apply to βremap-path-prefix
- Rustc
OptGroup - Target
Modifier - A recorded -Zopt_name=opt_value (or -Copt_name=opt_value) which alter the ABI or effectiveness of exploit mitigations.
- Unstable
Options
Enums§
- Auto
Diff - The different settings that the
-Z autodiff
flag can have. - CFGuard
- The different settings that the
-C control-flow-guard
flag can have. - CFProtection
- The different settings that the
-Z cf-protection
flag can have. - Codegen
Options Target Modifiers - Collapse
Macro Debuginfo - How to perform collapse macros debug info if-ext - if macro from different crate (related to callsite code) | cmd \ attr | no | (unspecified) | external | yes | | no | no | no | no | no | | (unspecified) | no | no | if-ext | yes | | external | no | if-ext | if-ext | yes | | yes | yes | yes | yes | yes |
- Coverage
Level - Controls whether branch coverage or MC/DC coverage is enabled.
- Crate
Type - Debug
Info - Debug
Info Compression - Dump
Mono Stats Format - Which format to use for
-Z dump-mono-stats
- Entry
FnType - Error
Output Type - The type of diagnostics output to generate.
- Expected
Values - Extern
Location - FmtDebug
- Values for the
-Z fmt-debug
flag. - Function
Return - The different settings that the
-Zfunction-return
flag can have. - Incremental
State Assertion - Used with
-Z assert-incr-state
. - Inlining
Threshold - Input
- Instrument
Coverage - The different settings that the
-C instrument-coverage
flag can have. - Json
Unused Externs - Report unused externs in event stream
- Linker
Plugin Lto - Lto
- This is what the
LtoCli
values get mapped to after resolving defaults and and taking other command line options into account. - LtoCli
- The different settings that the
-C lto
flag can have. - MirInclude
Spans - Whether extra span comments are included when dumping MIR, via the
-Z mir-include-spans
flag. By default, only enabled in the NLL MIR dumps, and disabled in all other passes. - MirStrip
Debug Info - OomStrategy
- Default behavior to use in out-of-memory situations.
- OptLevel
- Option
Kind - Option
Stability - Options
Target Modifiers - OutFile
Name - Output
Type - PAuth
Key - Passes
- Polonius
-Zpolonius
values, enabling the borrow checker polonius analysis, and which version: legacy, or future prototype.- PpHir
Mode - PpMode
- Pretty print mode
- PpSource
Mode - Print
Kind - Proc
Macro Execution Strategy - How to run proc-macro code when building this crate
- Resolve
DocLinks - Split
Dwarf Kind - Split debug-information is enabled by
-C split-debuginfo
, this enum is only used if split debug-information is enabled (in eitherPacked
orUnpacked
modes), and the platform uses DWARF for debug-information. - Strip
- The different settings that the
-C strip
flag can have. - Switch
With OptPath - Symbol
Mangling Version - Unstable
Options Target Modifiers - Wasi
Exec Model
Constants§
Statics§
- EDITION_
STRING π
Functions§
- build_
configuration - build_
session_ options - build_
target_ config - check_
error_ πformat_ stability - collect_
print_ πrequests - default_
lib_ πoutput - file_
path_ πmapping - get_
cmd_ lint_ options - host_
tuple - make_
crate_ type_ option - make_
opt - parse_
assert_ πincr_ state - parse_
color - Parses the
--color
flag. - parse_
crate_ edition - parse_
crate_ types_ from_ list - parse_
error_ format - Parses the
--error-format
flag. - parse_
externs - parse_
json - Parse the
--json
flag. - parse_
logical_ πenv - parse_
opt_ πlevel - parse_
output_ πtypes - parse_
pretty π - parse_
remap_ πpath_ prefix - parse_
target_ triple - rustc_
optgroups - Returns all rustc command line options, including metadata for each option, such as whether the option is stable.
- select_
debuginfo π - should_
override_ πcgus_ and_ disable_ thinlto - split_
out_ πfile_ name
Type Aliases§
- Cfg
- The parsed
--cfg
options that define the compilation environment of the crate, used to drive conditional compilation.