@@ -87,6 +87,21 @@ retry = 2 # network retries
8787git-fetch-with-cli = true # use the `git` executable for git operations
8888offline = false # do not access the network
8989
90+ [profile .<name> ] # Modify profile settings via config.
91+ opt-level = 0 # Optimization level.
92+ debug = true # Include debug info.
93+ debug-assertions = true # Enables debug assertions.
94+ overflow-checks = true # Enables runtime integer overflow checks.
95+ lto = false # Sets link-time optimization.
96+ panic = ' unwind' # The panic strategy.
97+ incremental = true # Incremental compilation.
98+ codegen-units = 16 # Number of code generation units.
99+ rpath = false # Sets the rpath linking option.
100+ [profile .<name> .build-override ] # Overrides build-script settings.
101+ # Same keys for a normal profile.
102+ [profile .<name> .package .<name> ] # Override profile for a package.
103+ # Same keys for a normal profile (minus `panic`, `lto`, and `rpath`).
104+
90105[registries .<name> ] # registries other than crates.io
91106index = " …" # URL of the registry index
92107token = " …" # authentication token for the registry
@@ -549,6 +564,93 @@ needed, and generate an error if it encounters a network error.
549564
550565Can be overridden with the ` --offline ` command-line option.
551566
567+ #### ` [profile] `
568+
569+ The ` [profile] ` table can be used to globally change profile settings, and
570+ override settings specified in ` Cargo.toml ` . It has the same syntax and
571+ options as profiles specified in ` Cargo.toml ` . See the [ Profiles chapter] for
572+ details about the options.
573+
574+ [ Profiles chapter ] : profiles.md
575+
576+ ##### ` [profile.<name>.build-override] `
577+ * Environment: ` CARGO_PROFILE_<name>_BUILD_OVERRIDE_<key> `
578+
579+ The build-override table overrides settings for build scripts, proc macros,
580+ and their dependencies. It has the same keys as a normal profile. See the
581+ [ overrides section] ( profiles.md#overrides ) for more details.
582+
583+ ##### ` [profile.<name>.package.<name>] `
584+ * Environment: not supported
585+
586+ The package table overrides settings for specific packages. It has the same
587+ keys as a normal profile, minus the ` panic ` , ` lto ` , and ` rpath ` settings. See
588+ the [ overrides section] ( profiles.md#overrides ) for more details.
589+
590+ ##### ` profile.<name>.codegen-units `
591+ * Type: integer
592+ * Default: See profile docs.
593+ * Environment: ` CARGO_PROFILE_<name>_CODEGEN_UNITS `
594+
595+ See [ codegen-units] ( profiles.md#codegen-units ) .
596+
597+ ##### ` profile.<name>.debug `
598+ * Type: integer or boolean
599+ * Default: See profile docs.
600+ * Environment: ` CARGO_PROFILE_<name>_DEBUG `
601+
602+ See [ debug] ( profiles.md#debug ) .
603+
604+ ##### ` profile.<name>.debug-assertions `
605+ * Type: boolean
606+ * Default: See profile docs.
607+ * Environment: ` CARGO_PROFILE_<name>_DEBUG_ASSERTIONS `
608+
609+ See [ debug-assertions] ( profiles.md#debug-assertions ) .
610+
611+ ##### ` profile.<name>.incremental `
612+ * Type: boolean
613+ * Default: See profile docs.
614+ * Environment: ` CARGO_PROFILE_<name>_INCREMENTAL `
615+
616+ See [ incremental] ( profiles.md#incremental ) .
617+
618+ ##### ` profile.<name>.lto `
619+ * Type: string or boolean
620+ * Default: See profile docs.
621+ * Environment: ` CARGO_PROFILE_<name>_LTO `
622+
623+ See [ lto] ( profiles.md#lto ) .
624+
625+ ##### ` profile.<name>.overflow-checks `
626+ * Type: boolean
627+ * Default: See profile docs.
628+ * Environment: ` CARGO_PROFILE_<name>_OVERFLOW_CHECKS `
629+
630+ See [ overflow-checks] ( profiles.md#overflow-checks ) .
631+
632+ ##### ` profile.<name>.opt-level `
633+ * Type: integer or string
634+ * Default: See profile docs.
635+ * Environment: ` CARGO_PROFILE_<name>_OPT_LEVEL `
636+
637+ See [ opt-level] ( profiles.md#opt-level ) .
638+
639+ ##### ` profile.<name>.panic `
640+ * Type: string
641+ * default: See profile docs.
642+ * Environment: ` CARGO_PROFILE_<name>_PANIC `
643+
644+ See [ panic] ( profiles.md#panic ) .
645+
646+ ##### ` profile.<name>.rpath `
647+ * Type: boolean
648+ * default: See profile docs.
649+ * Environment: ` CARGO_PROFILE_<name>_RPATH `
650+
651+ See [ rpath] ( profiles.md#rpath ) .
652+
653+
552654#### ` [registries] `
553655
554656The ` [registries] ` table is used for specifying additional [ registries] . It
0 commit comments