pub struct Profile {Show 14 fields
pub opt_level: Option<OptLevel>,
pub debug: Option<DebugSetting>,
pub split_debuginfo: Option<String>,
pub rpath: Option<bool>,
pub lto: Option<LtoSetting>,
pub debug_assertions: Option<bool>,
pub codegen_units: Option<u16>,
pub panic: Option<String>,
pub incremental: Option<bool>,
pub overflow_checks: Option<bool>,
pub strip: Option<StripSetting>,
pub package: BTreeMap<String, Self>,
pub build_override: Option<Box<Self>>,
pub inherits: Option<String>,
}Expand description
Compilation/optimization settings for a workspace
Fields§
§opt_level: Option<OptLevel>The opt-level setting controls the -C opt-level flag which controls the level of optimization.
debug: Option<DebugSetting>The debug setting controls the -C debuginfo flag which controls the amount of debug information included in the compiled binary.
split_debuginfo: Option<String>The split-debuginfo setting controls the -C split-debuginfo flag which controls whether debug information, if generated, is either placed in the executable itself or adjacent to it.
rpath: Option<bool>The rpath setting controls the -C rpath flag which controls whether or not rpath is enabled.
lto: Option<LtoSetting>The lto setting controls rustc’s -C lto, -C linker-plugin-lto, and -C embed-bitcode options, which control LLVM’s link time optimizations.
LTO can produce better optimized code, using whole-program analysis, at the cost of longer linking time.
debug_assertions: Option<bool>The debug-assertions setting controls the -C debug-assertions flag which turns cfg(debug_assertions) conditional compilation on or off.
codegen_units: Option<u16>The codegen-units setting controls the -C codegen-units flag which controls how many “code generation units” a crate will be split into.
More code generation units allows more of a crate to be processed in parallel possibly reducing compile time, but may produce slower code.
panic: Option<String>The panic setting controls the -C panic flag which controls which panic strategy to use.
The valid options are:
unwind: Unwind the stack upon panic.abort: Terminate the process upon panic.
incremental: Option<bool>The incremental setting controls the -C incremental flag which controls whether or not incremental compilation is enabled.
overflow_checks: Option<bool>The overflow-checks setting controls the -C overflow-checks flag which controls the behavior of runtime integer overflow.
strip: Option<StripSetting>The strip option controls the -C strip flag, which directs rustc to strip either symbols or debuginfo from a binary.
package: BTreeMap<String, Self>Profile settings can be overridden for specific packages and build-time crates.
To override the settings for a specific package, use the package table to change the settings for the named package:
# The `foo` package will use the -Copt-level=3 flag.
[profile.dev.package.foo]
opt-level = 3build_override: Option<Box<Self>>To override the settings for build scripts, proc macros, and their dependencies, use the build-override table:
# Set the settings for build scripts and proc-macros.
[profile.dev.build-override]
opt-level = 3inherits: Option<String>Specifies which profile the custom profile inherits settings from when the setting is not specified.