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.
- externs π
- This module contains code to help parse and manipulate --externarguments.
- native_libs π
- Parser for the -lcommand-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!
MacrosΒ§
- define_output_ πtypes 
StructsΒ§
- BranchProtection 
- CheckCfg 
- The parsed --check-cfgoptions.
- CodegenOptions 
- CoverageOptions 
- Individual flag values controlled by -Zcoverage-options.
- ExtendedTarget 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)β).
- ExternEntry 
- Externs
- Use tree-based collections to cheaply get a deterministic Hashimplementation. Do not switchBTreeMaporBTreeSetout for an unsorted container type! That would break dependency tracking for command-line arguments.
- InstrumentXRay 
- Settings for -Z instrument-xrayflag.
- JsonConfig 
- Possible json config files
- LinkSelf Contained 
- The different values -C link-self-containedcan 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.
- LinkerFeatures Cli 
- The different values that -C linker-featurescan 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-detailflag.
- NextSolver Config 
- OptionDesc 
- Options
- The top-level command-line options struct.
- OutputFilenames 
- OutputTypes 
- Use tree-based collections to cheaply get a deterministic Hashimplementation. Do not switchBTreeMapout 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
- PatchableFunction Entry 
- -Z patchable-function-entryrepresentation - how many nops to put before and after function entry.
- PrintRequest 
- RemapPath Scope Components 
- Scopes used to determined if it need to apply to βremap-path-prefix
- RustcOptGroup 
- Sysroot
- 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 autodiffflag can have.
- CFGuard
- The different settings that the -C control-flow-guardflag can have.
- CFProtection
- The different settings that the -Z cf-protectionflag can have.
- CodegenOptions Target Modifiers 
- CollapseMacro 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 |
- CoverageLevel 
- Controls whether branch coverage is enabled.
- CrateType 
- DebugInfo 
- DebugInfo Compression 
- DumpMono Stats Format 
- Which format to use for -Z dump-mono-stats
- EntryFnType 
- ErrorOutput Type 
- The type of diagnostics output to generate.
- ExpectedValues 
- ExternLocation 
- FmtDebug
- Values for the -Z fmt-debugflag.
- FunctionReturn 
- The different settings that the -Zfunction-returnflag can have.
- IncrementalState Assertion 
- Used with -Z assert-incr-state.
- InliningThreshold 
- Input
- InstrumentCoverage 
- The different settings that the -C instrument-coverageflag can have.
- JsonUnused Externs 
- Report unused externs in event stream
- LinkerPlugin Lto 
- Lto
- This is what the LtoClivalues get mapped to after resolving defaults and and taking other command line options into account.
- LtoCli
- The different settings that the -C ltoflag can have.
- MirIncludeSpans 
- Whether extra span comments are included when dumping MIR, via the -Z mir-include-spansflag. By default, only enabled in the NLL MIR dumps, and disabled in all other passes.
- MirStripDebug Info 
- Offload
- OomStrategy
- Default behavior to use in out-of-memory situations.
- OptLevel
- OptionKind 
- OptionStability 
- OptionsTarget Modifiers 
- OutFileName 
- OutputType 
- PAuthKey 
- Passes
- Polonius
- -Zpoloniusvalues, enabling the borrow checker polonius analysis, and which version: legacy, or future prototype.
- PpHirMode 
- PpMode
- Pretty print mode
- PpSourceMode 
- PrintKind 
- ProcMacro Execution Strategy 
- How to run proc-macro code when building this crate
- ResolveDocLinks 
- SplitDwarf Kind 
- Split debug-information is enabled by -C split-debuginfo, this enum is only used if split debug-information is enabled (in eitherPackedorUnpackedmodes), and the platform uses DWARF for debug-information.
- Strip
- The different settings that the -C stripflag can have.
- SwitchWith OptPath 
- SymbolMangling Version 
- UnstableOptions Target Modifiers 
- WasiExec Model 
ConstantsΒ§
StaticsΒ§
- EDITION_STRING π
- EMIT_HELP π
- PRINT_HELP π
FunctionsΒ§
- build_configuration 
- build_session_ options 
- build_target_ config 
- check_error_ πformat_ stability 
- check_print_ πrequest_ stability 
- collect_print_ πrequests 
- default_lib_ πoutput 
- emit_unknown_ πprint_ request_ help 
- file_path_ πmapping 
- get_cmd_ lint_ options 
- host_tuple 
- is_print_ πrequest_ stable 
- make_crate_ type_ option 
- make_opt 
- maybe_strip_ πfile_ name 
- Ensure the filename is not too long, as some filesystems have a limit. If the filename is too long, hash part of it and append the hash to the filename. This is a workaround for long crate names generating overly long filenames.
- parse_assert_ πincr_ state 
- parse_color 
- Parses the --colorflag.
- parse_crate_ edition 
- parse_crate_ types_ from_ list 
- parse_error_ format 
- Parses the --error-formatflag.
- parse_externs 
- parse_json 
- Parse the --jsonflag.
- 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 --cfgoptions that define the compilation environment of the crate, used to drive conditional compilation.