Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some profile documentation. #10153

Merged
merged 1 commit into from
Dec 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/doc/src/reference/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,13 @@ rpath = false

#### test

The `test` profile is used for building tests, or when benchmarks are built in
debug mode with `cargo build`. By default, the `test` profile inherits the
settings from the [`dev`](#dev) profile.
The `test` profile is the default profile used by [`cargo test`].
The `test` profile inherits the settings from the [`dev`](#dev) profile.

#### bench

The `bench` profile is used for building benchmarks, or when tests are built
with the `--release` flag. By default, the `bench` profile inherits the
settings from the [`release`](#release) profile.
The `bench` profile is the default profile used by [`cargo bench`].
The `bench` profile inherits the settings from the [`release`](#release) profile.

#### Build Dependencies

Expand All @@ -293,7 +291,7 @@ codegen-units = 256
```

Build dependencies otherwise inherit settings from the active profile in use, as
described below.
described in [Profile selection](#profile-selection).

### Custom profiles

Expand Down Expand Up @@ -331,11 +329,15 @@ The profile used depends on the command, the command-line flags like
`--release` or `--profile`, and the package (in the case of
[overrides](#overrides)). The default profile if none is specified is:

* Build commands like [`cargo build`], [`cargo rustc`], [`cargo check`], and
[`cargo run`]: [`dev` profile](#dev)
* [`cargo test`]: [`test` profile](#test)
* [`cargo bench`]: [`bench` profile](#bench)
* [`cargo install`]: [`release` profile](#release)
| Command | Default Profile |
|---------|-----------------|
| [`cargo run`], [`cargo build`],<br>[`cargo check`], [`cargo rustc`] | [`dev` profile](#dev) |
| [`cargo test`] | [`test` profile](#test)
| [`cargo bench`] | [`bench` profile](#bench)
| [`cargo install`] | [`release` profile](#release)

You can switch to a different profile using the `--profile=NAME` option which will used the given profile.
The `--release` flag is equivalent to `--profile=release`.

The selected profile applies to all Cargo targets,
including [library](./cargo-targets.md#library),
Expand Down