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. - mitigation_
coverage - native_
libs π - Parser for the
-lcommand-line option, which links the generated crate to a native library. - nightly_
options - parse
- print_
request π - Code for dealing with
--printrequests. - sigpipe
- NOTE: Keep these constants in sync with
library/std/src/sys/pal/unix/mod.rs!
MacrosΒ§
- define_
output_ πtypes
StructsΒ§
- Branch
Protection - Check
Cfg - The parsed
--check-cfgoptions. - Codegen
Options - Codegen
Retag Options - The different settings that the
-Z codegen-emit-retagflag can have. - Collected
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
Hashimplementation. Do not switchBTreeMaporBTreeSetout for an unsorted container type! That would break dependency tracking for command-line arguments. - Instrument
Mcount Opts - InstrumentX
Ray - Settings for
-Z instrument-xrayflag. - Jobs
Nonefor frontend and backend means everything is single-threaded and synchronization can be disabled.- Json
Config - Possible json config files
- Link
Self 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. - Linker
Features Cli - The different values that
-C linker-featurescan 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-detailflag. - 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
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
- Patchable
Function Entry -Z patchable-function-entryrepresentation - how many nops to put before and after function entry.- Print
Request - Rustc
OptGroup - Sysroot
- 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Β§
- Annotate
Moves - The different settings that the
-Z annotate-movesflag can have. - Auto
Diff - 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. - Codegen
Options Target Modifiers - Coverage
Level - Controls whether branch coverage is enabled.
- 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-debugflag. - Function
Return - The different settings that the
-Zfunction-returnflag can have. - Incremental
State Assertion - Used with
-Z assert-incr-state. - Inlining
Threshold - Input
- Instrument
Coverage - The different settings that the
-C instrument-coverageflag can have. - Instrument
Mcount - The different settings that the
-Z Instrument-mcountflag can have. - Json
Unused Externs - Report unused externs in event stream
- Linker
Jobs - Linker
Plugin 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. - MirInclude
Spans - 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. - MirStrip
Debug Info - Offload
- OptLevel
- Option
Kind - Option
Stability - Options
Target Modifiers - OutFile
Name - Output
Type - PAuth
Key - Passes
- Pointer
Auth Option - Polonius
-Zpoloniusvalues, enabling the borrow checker polonius analysis, and which version: legacy, or future prototype.- PpHir
Mode - PpMode
- Pretty print mode
- PpSource
Mode - Print
Category - 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 eitherPackedorUnpackedmodes), and the platform uses DWARF for debug-information. - Strip
- The different settings that the
-C stripflag can have. - Switch
With OptPath - Symbol
Mangling Version - Unstable
Options Target Modifiers - Wasi
Exec Model
ConstantsΒ§
- CG_
OPTIONS - DWARF_
OBJECT_ EXT - MAX_
FILENAME_ LENGTH - NATIVE_
CPU - Special CPU name requesting the CPU of the current host.
- RLINK_
EXT - RUST_
CGU_ EXT - Z_
OPTIONS
StaticsΒ§
- EDITION_
STRING π - EMIT_
HELP π
FunctionsΒ§
- build_
configuration - build_
session_ options - build_
target_ config - check_
error_ πformat_ stability - collect_
print_ requests - file_
path_ πmapping - get_
cmd_ lint_ options - host_
tuple - Get the host triple out of the build environment. This ensures that our idea of the host triple is the same as for the set of libraries weβve actually built. We canβt just take LLVMβs host triple because they normalize all ix86 architectures to i386.
- 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_
color - Parses the
--colorflag. - parse_
crate_ edition - parse_
crate_ types_ from_ list - parse_
error_ format - Parses the
--error-formatflag. - parse_
externs - parse_
jobs_ πall - parse_
jobs_ πone - parse_
json - Parse the
--jsonflag. - parse_
opt_ πlevel - parse_
output_ πtypes - parse_
pretty π - parse_
remap_ πpath_ prefix - parse_
remap_ path_ scope - 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.