Module config

Source
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§

BranchProtection
CheckCfg
The parsed --check-cfg options.
CodegenOptions
CoverageOptions
Individual flag values controlled by -Zcoverage-options.
ExtendedTargetModifierInfo
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)’).
ExternEntry
Externs
Use tree-based collections to cheaply get a deterministic Hash implementation. Do not switch BTreeMap or BTreeSet out for an unsorted container type! That would break dependency tracking for command-line arguments.
InstrumentXRay
Settings for -Z instrument-xray flag.
JsonConfig
Possible json config files
LinkSelfContained
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.
LinkerFeaturesCli
The different values that -Z linker-features can take on the CLI: a list of individually enabled or disabled features used during linking.
LocationDetail
The different settings that can be enabled via the -Z location-detail flag.
NextSolverConfig
OptionDesc
Options
The top-level command-line options struct.
OutputFilenames
OutputTypes
Use tree-based collections to cheaply get a deterministic Hash implementation. Do not switch BTreeMap 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
PatchableFunctionEntry
-Z patchable-function-entry representation - how many nops to put before and after function entry.
PrintRequest
RemapPathScopeComponents
Scopes used to determined if it need to apply to –remap-path-prefix
RustcOptGroup
TargetModifier
A recorded -Zopt_name=opt_value (or -Copt_name=opt_value) which alter the ABI or effectiveness of exploit mitigations.
UnstableOptions

Enums§

AutoDiff
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.
CodegenOptionsTargetModifiers
CollapseMacroDebuginfo
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 |
CoverageLevel
Controls whether branch coverage or MC/DC coverage is enabled.
CrateType
DebugInfo
DebugInfoCompression
DumpMonoStatsFormat
Which format to use for -Z dump-mono-stats
EntryFnType
ErrorOutputType
The type of diagnostics output to generate.
ExpectedValues
ExternLocation
FmtDebug
Values for the -Z fmt-debug flag.
FunctionReturn
The different settings that the -Zfunction-return flag can have.
IncrementalStateAssertion
Used with -Z assert-incr-state.
InliningThreshold
Input
InstrumentCoverage
The different settings that the -C instrument-coverage flag can have.
JsonUnusedExterns
Report unused externs in event stream
LinkerPluginLto
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.
MirIncludeSpans
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.
MirStripDebugInfo
OomStrategy
Default behavior to use in out-of-memory situations.
OptLevel
OptionKind
OptionStability
OptionsTargetModifiers
OutFileName
OutputType
PAuthKey
Passes
Polonius
-Zpolonius values, enabling the borrow checker polonius analysis, and which version: legacy, or future prototype.
PpHirMode
PpMode
Pretty print mode
PpSourceMode
PrintKind
ProcMacroExecutionStrategy
How to run proc-macro code when building this crate
ResolveDocLinks
SplitDwarfKind
Split debug-information is enabled by -C split-debuginfo, this enum is only used if split debug-information is enabled (in either Packed or Unpacked modes), and the platform uses DWARF for debug-information.
Strip
The different settings that the -C strip flag can have.
SwitchWithOptPath
SymbolManglingVersion
UnstableOptionsTargetModifiers
WasiExecModel

Constants§

CG_OPTIONS
DWARF_OBJECT_EXT
RLINK_EXT
RUST_CGU_EXT
Z_OPTIONS

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.